lib/liberty_buildpack/container/dist_zip.rb
# Find a start script relative to a root directory.  A start script is defined as existing in the +bin/+ directory
# and being either the only file, or the only file with a counterpart named +<filename>.bat+
#
# @param [Pathname] root the root to search from
# @return [Pathname, nil] the start script or +nil+ if one does not exist
Find a start script relative to a root directory.  A start script is defined as existing in the +bin/+ directory
and being either the only file, or the only file with a counterpart named +.bat+
Find a start script relative to a root directory . A start script is defined as existing in the + bin / + directory and being either the only file or the only file with a counterpart named + . bat +
def start_script(root)
      return nil unless root
      candidates = Dir.glob(File.join(root, 'bin/*'))
      if candidates.size == 1
        candidates.first
      else
        Dir.glob(File.join(root, 'bin'))
        candidates.find { |candidate| Pathname.new("#{candidate}.bat").exist? }
      end
    end
def start_script ( root ) return nil unless root candidates = Dir . glob ( File . join ( root , 'bin/*' ) ) if candidates . size == 1 candidates . first else Dir . glob ( File . join ( root , 'bin' ) ) candidates . find { | candidate | Pathname . new ( "#{candidate}.bat" ) . exist? } end end
Find a start script relative to a root directory.
Find a start script relative to a root directory .
the start script or +nil+ if one does not exist
the start script or + nil + if one does not exist
Pathname, nil
root
root the root to search from
root the root to search from