mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
checkPlugin: Compare entire file
This commit is contained in:
parent
f0669a8d31
commit
51c530a3a0
3 changed files with 1 additions and 10 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue