Add logic to update submodules and licenses

This commit is contained in:
Alhadis
2016-09-07 04:25:00 +10:00
parent f382abc2f3
commit 4584963dd2
2 changed files with 31 additions and 14 deletions

View File

@@ -4,6 +4,7 @@
require "bundler/setup"
require "licensed/cli"
require "optparse"
module Licensed
module Source
@@ -32,7 +33,14 @@ module Licensed
end
end
source = Licensed::Source::Filesystem.new("vendor/grammars/*/", type: "grammar")
module_path = nil
OptionParser.new do |opts|
opts.on("-mPATH", "--module=PATH", "Cache license file for specific grammar") do |p|
module_path = p
end
end.parse!
source = Licensed::Source::Filesystem.new(module_path || "vendor/grammars/*/", type: "grammar")
config = Licensed::Configuration.new
config.sources << source
@@ -43,4 +51,5 @@ else
end
command.run
`git checkout -- vendor/licenses/grammar/` if module_path
exit command.success?