From 3ae5937158ef8e040eae122bb12c1a7caea99a9b Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 30 Jul 2020 15:51:26 -0500 Subject: [PATCH] Update noticeme to 1.0.0-pre5 --- lib/tasks/notice.rake | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/tasks/notice.rake b/lib/tasks/notice.rake index 5c8a5e25..47da5ffd 100644 --- a/lib/tasks/notice.rake +++ b/lib/tasks/notice.rake @@ -39,25 +39,16 @@ namespace :notice do end namespace :js do - require 'fileutils' - 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 + notice_cmd = "npx @houdiniproject/noticeme@^1.0.0-pre5 -f NOTICE-js -i included.json" desc "generating NOTICE-js from ClearlyDefined.io" task :update do - if (File.exists?('NOTICE')) - File.delete('NOTICE') - end - result = get_notice_js - FileUtils.mv('NOTICE', 'NOTICE-js', force: true) + raise "NOTICE-js could not be updated" unless system(notice_cmd + " -u") end desc "checking whether NOTICE-js matches the one on ClearlyDefined.io" 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." if result != File.read('NOTICE-js') + raise "NOTICE-js is not up to date. Run bin/rails notice:js:update to update the file" unless system(notice_cmd) end end end \ No newline at end of file