Skip to content

Commit 0ea4ee4

Browse files
authored
DEV: Add usage info to auto_build script (#626)
1 parent 7abc94a commit 0ea4ee4

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

image/auto_build.rb

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,25 @@ def dev_deps()
3939
run("cp ../templates/redis.template.yml discourse_dev/redis.template.yml")
4040
end
4141

42-
image = ARGV[0].intern
43-
raise 'Image not found' unless images.include?(image)
42+
if ARGV.length != 1
43+
puts <<~TEXT
44+
Usage:
45+
ruby auto_build.rb IMAGE
46+
47+
Available images:
48+
#{images.keys.join(", ")}
49+
TEXT
50+
exit 1
51+
else
52+
image = ARGV[0].to_sym
53+
54+
if !images.include?(image)
55+
$stderr.puts "Image not found"
56+
exit 1
57+
end
4458

45-
puts "Building #{images[image]}"
46-
dev_deps() if image == :discourse_dev
59+
puts "Building #{images[image]}"
60+
dev_deps() if image == :discourse_dev
4761

48-
build(images[image])
62+
build(images[image])
63+
end

0 commit comments

Comments
 (0)