From a7a2dfbbd01772802d525f2f91f3505a60f1c811 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Mon, 20 Dec 2021 16:48:40 +0100 Subject: [PATCH] Tools: Allow the server clean command to run on Windows --- packages/server/gulpfile.js | 13 ++++++++++--- packages/server/package.json | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/server/gulpfile.js b/packages/server/gulpfile.js index e9924b82b..0045e41f3 100644 --- a/packages/server/gulpfile.js +++ b/packages/server/gulpfile.js @@ -3,12 +3,19 @@ const utils = require('@joplin/tools/gulp/utils'); const compilePackageInfo = require('@joplin/tools/compilePackageInfo'); const fs = require('fs-extra'); +const distDir = `${__dirname}/dist`; + const tasks = { compilePackageInfo: { fn: async () => { - const targetDir = `${__dirname}/dist`; - await fs.mkdirp(targetDir); - await compilePackageInfo(`${__dirname}/package.json`, `${targetDir}/packageInfo.js`); + await fs.mkdirp(distDir); + await compilePackageInfo(`${__dirname}/package.json`, `${distDir}/packageInfo.js`); + }, + }, + + clean: { + fn: async () => { + await fs.remove(distDir); }, }, }; diff --git a/packages/server/package.json b/packages/server/package.json index 5a710fcd9..2cb447076 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -16,7 +16,7 @@ "test": "jest --verbose=false", "test-ci": "yarn test", "test-debug": "node --inspect node_modules/.bin/jest -- --verbose=false", - "clean": "rm -rf dist/", + "clean": "gulp clean", "stripeListen": "stripe listen --forward-to http://joplincloud.local:22300/stripe/webhook", "watch": "tsc --watch --project tsconfig.json" },