Update noticeme to 1.0.0-pre5

This commit is contained in:
Eric 2020-07-30 15:51:26 -05:00 committed by Eric Schultz
parent a55e2ea5b1
commit 3ae5937158

View file

@ -39,25 +39,16 @@ namespace :notice do
end end
namespace :js do namespace :js do
require 'fileutils' notice_cmd = "npx @houdiniproject/noticeme@^1.0.0-pre5 -f NOTICE-js -i included.json"
def get_notice_js
raise "NOTICE-js could not be retrieved from Clearlydefined.io" unless system('npx noticeme@https://github.com/houdiniproject/noticeme')
File.read('NOTICE')
end
desc "generating NOTICE-js from ClearlyDefined.io" desc "generating NOTICE-js from ClearlyDefined.io"
task :update do task :update do
if (File.exists?('NOTICE')) raise "NOTICE-js could not be updated" unless system(notice_cmd + " -u")
File.delete('NOTICE')
end
result = get_notice_js
FileUtils.mv('NOTICE', 'NOTICE-js', force: true)
end end
desc "checking whether NOTICE-js matches the one on ClearlyDefined.io" desc "checking whether NOTICE-js matches the one on ClearlyDefined.io"
task :verify do task :verify do
result = get_notice_js raise "NOTICE-js is not up to date. Run bin/rails notice:js:update to update the file" unless system(notice_cmd)
raise "NOTICE-js is not up to date. Run bin/rails notice:js:update to update the file." if result != File.read('NOTICE-js')
end end
end end
end end