release: cd to Etherpad root directory

This commit is contained in:
Richard Hansen 2021-02-15 15:47:47 -05:00 committed by John McLear
parent 565d020876
commit 1ada0ab5d6

View file

@ -6,6 +6,7 @@ process.on('unhandledRejection', (err) => { throw err; });
const fs = require('fs'); const fs = require('fs');
const childProcess = require('child_process'); const childProcess = require('child_process');
const path = require('path');
const semver = require('semver'); const semver = require('semver');
/* /*
@ -25,6 +26,9 @@ if (!release) {
throw new Error('No release type included'); throw new Error('No release type included');
} }
const cwd = path.join(fs.realpathSync(__dirname), '../../');
process.chdir(cwd);
const readJson = (filename) => JSON.parse(fs.readFileSync(filename, {encoding: 'utf8', flag: 'r'})); const readJson = (filename) => JSON.parse(fs.readFileSync(filename, {encoding: 'utf8', flag: 'r'}));
const writeJson = (filename, obj) => { const writeJson = (filename, obj) => {
let json = JSON.stringify(obj, null, 2); let json = JSON.stringify(obj, null, 2);