From 51c530a3a0798888daf8b6e7fcabe7f512f56024 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 14 Jun 2021 19:54:37 -0400 Subject: [PATCH] checkPlugin: Compare entire file --- src/bin/plugins/checkPlugin.js | 5 +---- src/bin/plugins/lib/backend-tests.yml | 3 --- src/bin/plugins/lib/npmpublish.yml | 3 --- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/bin/plugins/checkPlugin.js b/src/bin/plugins/checkPlugin.js index d3b932a82..ed94365d1 100755 --- a/src/bin/plugins/checkPlugin.js +++ b/src/bin/plugins/checkPlugin.js @@ -107,16 +107,13 @@ const prepareRepo = () => { const checkFile = (srcFn, dstFn) => { const outFn = path.join(pluginPath, dstFn); - const verRegEx = /^##ETHERPAD_NPM_V=(\d+)$/; const wantContents = fs.readFileSync(srcFn, {encoding: 'utf8'}); - const [, wantVer] = verRegEx.exec(wantContents) || []; let gotContents = null; try { gotContents = fs.readFileSync(outFn, {encoding: 'utf8'}); } catch (err) { /* treat as if the file doesn't exist */ } - const [, gotVer] = verRegEx.exec(gotContents || '') || []; try { - assert.equal(gotVer, wantVer); + assert.equal(gotContents, wantContents); } catch (err) { console.warn(`File ${dstFn} is out of date`); console.warn(err.message); diff --git a/src/bin/plugins/lib/backend-tests.yml b/src/bin/plugins/lib/backend-tests.yml index a4a01530d..0451596f8 100644 --- a/src/bin/plugins/lib/backend-tests.yml +++ b/src/bin/plugins/lib/backend-tests.yml @@ -59,6 +59,3 @@ jobs: - name: Run the backend tests run: cd src && npm test - -# Automatically generated by src/bin/plugins/checkPlugin.js -##ETHERPAD_NPM_V=3 diff --git a/src/bin/plugins/lib/npmpublish.yml b/src/bin/plugins/lib/npmpublish.yml index f05a532da..5bbc1ca8c 100644 --- a/src/bin/plugins/lib/npmpublish.yml +++ b/src/bin/plugins/lib/npmpublish.yml @@ -85,6 +85,3 @@ jobs: - run: npm publish env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - -# Automatically generated by src/bin/plugins/checkPlugin.js -##ETHERPAD_NPM_V=3