mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
add-grammar: avoid running Docker by default
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user