mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
add-grammar: avoid running Docker by default
This commit is contained in:
@@ -64,6 +64,7 @@ Examples:
|
|||||||
|
|
||||||
$replace = nil
|
$replace = nil
|
||||||
$verbose = true
|
$verbose = true
|
||||||
|
$compile = false
|
||||||
|
|
||||||
OptionParser.new do |opts|
|
OptionParser.new do |opts|
|
||||||
opts.banner = usage
|
opts.banner = usage
|
||||||
@@ -73,6 +74,9 @@ OptionParser.new do |opts|
|
|||||||
opts.on("-rSUBMODULE", "--replace=SUBMODDULE", "Replace an existing grammar submodule.") do |name|
|
opts.on("-rSUBMODULE", "--replace=SUBMODDULE", "Replace an existing grammar submodule.") do |name|
|
||||||
$replace = name
|
$replace = name
|
||||||
end
|
end
|
||||||
|
opts.on("-C", "--compile", "Compile grammar using the new grammar-compiler.") do
|
||||||
|
$compile = true
|
||||||
|
end
|
||||||
end.parse!
|
end.parse!
|
||||||
|
|
||||||
|
|
||||||
@@ -96,12 +100,12 @@ if repo_old
|
|||||||
log "Deregistering: #{repo_old}"
|
log "Deregistering: #{repo_old}"
|
||||||
command('git', 'submodule', 'deinit', repo_old)
|
command('git', 'submodule', 'deinit', repo_old)
|
||||||
command('git', 'rm', '-rf', repo_old)
|
command('git', 'rm', '-rf', repo_old)
|
||||||
command('script/grammar-compiler', 'update', '-f')
|
command('script/grammar-compiler', 'update', '-f') if $compile
|
||||||
end
|
end
|
||||||
|
|
||||||
log "Registering new submodule: #{repo_new}"
|
log "Registering new submodule: #{repo_new}"
|
||||||
command('git', 'submodule', 'add', '-f', https, 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"
|
log "Confirming license"
|
||||||
if repo_old
|
if repo_old
|
||||||
|
|||||||
Reference in New Issue
Block a user