diff --git a/package.json b/package.json index 1d91c64754..949458026d 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "setupNewRelease": "node ./packages/tools/setupNewRelease", "clean": "lerna clean -y && lerna run clean", "linkChecker": "linkchecker https://joplinapp.org", + "releaseDesktop": "node packages/tools/release-electron.js", "publishAll": "git pull && lerna version --no-git-tag-version && gulp completePublishAll" }, "husky": { diff --git a/packages/tools/release-electron.js b/packages/tools/release-electron.js index dcc66d16d4..3751dfd08f 100644 --- a/packages/tools/release-electron.js +++ b/packages/tools/release-electron.js @@ -1,7 +1,5 @@ -const { execCommand, githubRelease } = require('./tool-utils.js'); -const path = require('path'); +const { execCommand, githubRelease, rootDir } = require('./tool-utils.js'); -const rootDir = path.dirname(__dirname); const appDir = `${rootDir}/packages/app-desktop`; async function main() { diff --git a/packages/tools/tool-utils.js b/packages/tools/tool-utils.js index ea6b76e8e2..7543ff0fdf 100644 --- a/packages/tools/tool-utils.js +++ b/packages/tools/tool-utils.js @@ -58,6 +58,9 @@ toolUtils.credentialDir = async function() { throw new Error(`Could not find credential directory in any of these paths: ${JSON.stringify(toTry)}`); }; +// Returns the project root dir +toolUtils.rootDir = require('path').dirname(require('path').dirname(__dirname)); + toolUtils.credentialFile = async function(filename) { const rootDir = await toolUtils.credentialDir(); const output = `${rootDir}/${filename}`;