Skip to content

Commit

Permalink
feat: adrift version number
Browse files Browse the repository at this point in the history
  • Loading branch information
hmerritt committed Mar 1, 2024
1 parent 8dc9d15 commit 9bfb3c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion bootstrap.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ const packageJSON = require("./package.json");
const path = __dirname;
const args = process.argv.slice(2);

// Internal adrift version. Useful for debugging.
const adriftVersion = "0.10.437";

// Run bootrap
bootstrap();

Expand Down Expand Up @@ -41,7 +44,7 @@ async function bootstrap() {
if (isTest) env[0][1] = "test";

// Log app name and version info
console.log(`${core.versionString(appName, appVersion, gitBranch, gitCommitHashShort)}\n`);
console.log(core.versionString(adriftVersion, appName, appVersion, gitBranch, gitCommitHashShort), "\n");

// Run bootstrap script
core.bootstrap(env, allowEnvOverride, args, path);
Expand Down
4 changes: 3 additions & 1 deletion scripts/bootstrap/core.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function runStream(command, path = __dirname, exitOnError = true) {
*
* E.g `App [Version 1.0.0 (development 4122b6...dc7c)]`
*/
const versionString = (appName = undefined, appVersion = undefined, gitBranch = undefined, gitCommitHash = undefined) => {
const versionString = (adriftVersion = undefined, appName = undefined, appVersion = undefined, gitBranch = undefined, gitCommitHash = undefined) => {
if (!appVersion) {
return `${appName} [Version unknown]`;
}
Expand All @@ -203,6 +203,8 @@ const versionString = (appName = undefined, appVersion = undefined, gitBranch =

versionString += `]`;

if (adriftVersion) versionString += ` with \x1b[36madrift@${adriftVersion}\x1b[0m`;

return versionString;
};

Expand Down

0 comments on commit 9bfb3c3

Please sign in to comment.