mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
Fix adding/replacing a grammar (#4097)
* Licensed needs a full path now
* Add docker installed/running guard
* Docker is required for adding/replacing grammars
* Use more elegant method
Hat-tip to @Alhadis 🎩
This commit is contained in:
@@ -84,6 +84,10 @@ unless $url
|
||||
exit 1;
|
||||
end
|
||||
|
||||
# Exit early if docker isn't installed or running.
|
||||
log "Checking docker is installed and running"
|
||||
command('docker', 'ps')
|
||||
|
||||
# Ensure the given URL is an HTTPS link
|
||||
parts = parse_url $url
|
||||
https = "https://#{parts[:host]}/#{parts[:user]}/#{parts[:repo]}"
|
||||
@@ -107,6 +111,7 @@ log "Confirming license"
|
||||
if repo_old
|
||||
command('script/licensed')
|
||||
else
|
||||
repo_new = File.absolute_path(repo_new)
|
||||
command('script/licensed', '--module', repo_new)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user