fix: Add missing cli folder in electron-app
This commit is contained in:
2 files changed
+24
-1
No files matched your search
@@ -93,7 +93,7 @@ ember-dist/
|
||||
ember-test/
|
||||
|
||||
# CLI
|
||||
cli/
|
||||
/cli/
|
||||
|
||||
# Autoupdate
|
||||
nextVersion/
|
||||
@@ -0,0 +1,23 @@
|
||||
const path = require('path');
|
||||
const { spawnSync } = require('../helpers/spawn-promise.js');
|
||||
|
||||
const cliPath = async () => path.resolve(__dirname, '..', 'cli', 'boundary');
|
||||
|
||||
module.exports = {
|
||||
// Check boundary cli existence
|
||||
exists: () => Boolean(cliPath()),
|
||||
|
||||
// Returns JSON-formatted version information from the CLI
|
||||
version: () => {
|
||||
const command = ['-v'];
|
||||
const rawOutput = spawnSync(command);
|
||||
let gitRevision = /Git Revision:\s*(?<rev>.*)\n/.exec(rawOutput);
|
||||
let versionNumber = /Version Number:\s*(?<ver>.*)\n/.exec(rawOutput);
|
||||
if (gitRevision) gitRevision = gitRevision.groups.rev;
|
||||
if (versionNumber) versionNumber = versionNumber.groups.ver;
|
||||
const formatted = versionNumber
|
||||
? `CLI Version: ${versionNumber}\nCLI Commit: ${gitRevision}`
|
||||
: `CLI Commit: ${gitRevision}`;
|
||||
return { gitRevision, versionNumber, formatted };
|
||||
},
|
||||
};
|
||||
Reference in new issue
Block a user