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:
Colin Seymour
2018-04-12 12:14:25 +02:00
committed by GitHub
parent a9ff59aef5
commit cc4da98616
2 changed files with 7 additions and 2 deletions

View File

@@ -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