From 9df9250b86edd2a0b9c4d11a76800a5ad0fe9da5 Mon Sep 17 00:00:00 2001 From: Momtchil Momtchev Date: Wed, 25 Sep 2024 12:20:04 +0200 Subject: [PATCH] os-agnostic date --- .github/workflows/node.js.yml | 3 ++- webpack.config.cjs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 3d923c3..eead7af 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -27,7 +27,8 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run lint - - run: | + - name: nexe test + run: | ./dist/`node -p \ '({"linux": "igc-xc-score-linux", "darwin": "igc-xc-score-macos", "win32": "igc-xc-score.exe"}[os.platform()])'` \ test/marcourt.igc diff --git a/webpack.config.cjs b/webpack.config.cjs index 839250b..2f73067 100644 --- a/webpack.config.cjs +++ b/webpack.config.cjs @@ -6,7 +6,8 @@ const exec = require('child_process'); const build_pkg = require('./package.json'); const build_git = exec.execSync('git rev-parse --short HEAD').toString(); -const build_date = exec.execSync('date -u +"%Y-%m-%d"').toString(); +const now = new Date; +const build_date = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')}`; module.exports = (env, argv) => ({ mode: 'none',