mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Fix add-grammar and convert-grammars (#3354)
* Skip removed grammar submodule
* Clean up old grammar from grammars and grammars.yml
* Clean up unused grammar license
Run `script/licensed`.
This was missing change in 12f9295 of #3350.
* Clean up license files when we replace grammar
Update license files by running `script/licensed`.
Since we replace grammar, the old grammar license must be removed
and new grammar license must be added.
This commit is contained in:
committed by
Brandon Black
parent
675cee1d72
commit
e1ce88920d
@@ -84,6 +84,7 @@ if repo_old
|
|||||||
log "Deregistering: #{repo_old}"
|
log "Deregistering: #{repo_old}"
|
||||||
`git submodule deinit #{repo_old}`
|
`git submodule deinit #{repo_old}`
|
||||||
`git rm -rf #{repo_old}`
|
`git rm -rf #{repo_old}`
|
||||||
|
`script/convert-grammars`
|
||||||
end
|
end
|
||||||
|
|
||||||
log "Registering new submodule: #{repo_new}"
|
log "Registering new submodule: #{repo_new}"
|
||||||
@@ -92,7 +93,11 @@ exit 1 if $?.exitstatus > 0
|
|||||||
`script/convert-grammars --add #{repo_new}`
|
`script/convert-grammars --add #{repo_new}`
|
||||||
|
|
||||||
log "Confirming license"
|
log "Confirming license"
|
||||||
|
if repo_old
|
||||||
|
`script/licensed`
|
||||||
|
else
|
||||||
`script/licensed --module "#{repo_new}"`
|
`script/licensed --module "#{repo_new}"`
|
||||||
|
end
|
||||||
|
|
||||||
log "Updating grammar documentation in vendor/REAEDME.md"
|
log "Updating grammar documentation in vendor/REAEDME.md"
|
||||||
`bundle exec rake samples`
|
`bundle exec rake samples`
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ end
|
|||||||
def load_grammars(tmp_dir, source, all_scopes)
|
def load_grammars(tmp_dir, source, all_scopes)
|
||||||
is_url = source.start_with?("http:", "https:")
|
is_url = source.start_with?("http:", "https:")
|
||||||
return [] if is_url && !$options[:remote]
|
return [] if is_url && !$options[:remote]
|
||||||
|
return [] if !is_url && !File.exist?(source)
|
||||||
|
|
||||||
p = if !is_url
|
p = if !is_url
|
||||||
if File.directory?(source)
|
if File.directory?(source)
|
||||||
|
|||||||
Reference in New Issue
Block a user