feat: env CODE_PRELOADER_DETECT=no disables config auto-detect
This commit is contained in:
parent
d39d597128
commit
bde15cfd25
1 changed files with 5 additions and 3 deletions
|
@ -86,8 +86,10 @@ module CodePreloader
|
||||||
def parse_pack_options(parser)
|
def parse_pack_options(parser)
|
||||||
@pack_options = PackOptions.new
|
@pack_options = PackOptions.new
|
||||||
|
|
||||||
|
unless ENV["CODE_PRELOADER_DETECT"]? =~ /(no|false|0)/i
|
||||||
config_file = detect_config_file
|
config_file = detect_config_file
|
||||||
config_file.try { |path| load_pack_config(path) }
|
config_file.try { |path| load_pack_config(path) }
|
||||||
|
end
|
||||||
|
|
||||||
parser.banner = [
|
parser.banner = [
|
||||||
"Usage: code-preloader pack [options] DIR ...\n",
|
"Usage: code-preloader pack [options] DIR ...\n",
|
||||||
|
@ -99,7 +101,7 @@ module CodePreloader
|
||||||
parser.on(
|
parser.on(
|
||||||
"-c FILE",
|
"-c FILE",
|
||||||
"--config=FILE",
|
"--config=FILE",
|
||||||
"Load parameters from FILE\n(default: \".code_preload.yml\", if present)"
|
"Load parameters from FILE\n(default: autodetect)"
|
||||||
) do |config_file|
|
) do |config_file|
|
||||||
@pack_options.try { |opt| load_pack_config(config_file) }
|
@pack_options.try { |opt| load_pack_config(config_file) }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue