From bc57d229fac13c516e6dbb8c271bc7abc51ca0ae Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 5 Nov 2020 17:44:19 +0000 Subject: [PATCH] Tools: Fix desktop build --- package.json | 1 + packages/tools/release-electron.js | 4 +--- packages/tools/tool-utils.js | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) 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}`;