Skip to content

Commit 0db8b7a

Browse files
author
dwest15
committed
Add —drafts and pass as 6th param to deploy
1 parent 80c9f6d commit 0db8b7a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/jgd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Usage: jgd [options]
1313
opt :branch_from, 'Source branch', type: String, default: 'master'
1414
opt :config, 'Deploy Config File', type: String, default: '_config-deploy.yml'
1515
opt :bundle, 'Use bundle'
16+
opt :drafts, 'Generate drafts'
1617
end
1718

1819
branch = opts[:branch]
@@ -23,11 +24,12 @@ fail 'branch-from can\'t be empty' if branch_from.empty?
2324
fail 'config can\'t be empty' if config.empty?
2425
url = opts[:url]
2526
url = `git config --get remote.origin.url`.strip if url.empty?
26-
bundle = opts[:bundle] ? '"bundle exec"' : ''
27+
bundle = opts[:bundle] ? '"bundle exec"' : '""'
28+
drafts = opts[:drafts] ? '"--drafts"' : '""'
2729

2830
spec = Gem::Specification.find_by_name('jgd')
2931
root = spec.gem_dir
3032
script = File.join(root, 'bash/deploy.sh')
3133

3234
fail 'deployment failed, see log above' \
33-
unless system("#{script} #{url} #{branch} #{branch_from} #{config} #{bundle}")
35+
unless system("#{script} #{url} #{branch} #{branch_from} #{config} #{bundle} #{drafts}")

0 commit comments

Comments
 (0)