From 13f83372a2e66cbd5fe286ca41b70c9ad1cd0194 Mon Sep 17 00:00:00 2001 From: Alhadis Date: Mon, 9 Apr 2018 13:24:48 +1000 Subject: [PATCH] add-grammar: avoid running Docker by default --- script/add-grammar | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/script/add-grammar b/script/add-grammar index 1b4f71d0..1d16f063 100755 --- a/script/add-grammar +++ b/script/add-grammar @@ -64,6 +64,7 @@ Examples: $replace = nil $verbose = true +$compile = false OptionParser.new do |opts| opts.banner = usage @@ -73,6 +74,9 @@ OptionParser.new do |opts| opts.on("-rSUBMODULE", "--replace=SUBMODDULE", "Replace an existing grammar submodule.") do |name| $replace = name end + opts.on("-C", "--compile", "Compile grammar using the new grammar-compiler.") do + $compile = true + end end.parse! @@ -96,12 +100,12 @@ if repo_old log "Deregistering: #{repo_old}" command('git', 'submodule', 'deinit', repo_old) command('git', 'rm', '-rf', repo_old) - command('script/grammar-compiler', 'update', '-f') + command('script/grammar-compiler', 'update', '-f') if $compile end log "Registering new submodule: #{repo_new}" command('git', 'submodule', 'add', '-f', https, repo_new) -command('script/grammar-compiler', 'add', repo_new) +command('script/grammar-compiler', 'add', repo_new) if $compile log "Confirming license" if repo_old