From 514500bb72e774b2a7d764f933dfaed3b56791b4 Mon Sep 17 00:00:00 2001 From: Evan Simkowitz Date: Thu, 13 Jun 2024 18:11:21 -0700 Subject: [PATCH] Get version for Taskfile from version.js (#49) Make version.js runnable to output the current version, get the VERSION variable in the Taskfile from this script. --- Taskfile.yml | 3 ++- version.js => version.cjs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) rename version.js => version.cjs (64%) diff --git a/Taskfile.yml b/Taskfile.yml index 45928b20..e3dc52fd 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -6,7 +6,8 @@ version: "3" vars: APP_NAME: "NextWave" BIN_DIR: "bin" - VERSION: "0.1.0" + VERSION: + sh: node version.cjs tasks: generate: diff --git a/version.js b/version.cjs similarity index 64% rename from version.js rename to version.cjs index 1884c00b..512131da 100644 --- a/version.js +++ b/version.cjs @@ -3,3 +3,7 @@ const packageJson = require(path.resolve(__dirname, "package.json")); const VERSION = `${packageJson.version}`; module.exports = VERSION; + +if (typeof require !== "undefined" && require.main === module) { + console.log(VERSION); +}