fix: Add missing cli folder in electron-app

This commit is contained in:
Susmitha Girumala committed 2021-05-12 16:57:27 -04:00
1 parent 56936f78b8
commit 13146975e2
2 files changed
+24 -1

No files matched your search

+1 -1
View File
@@ -93,7 +93,7 @@ ember-dist/
ember-test/
# CLI
cli/
/cli/
# Autoupdate
nextVersion/
+23
View File
@@ -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 };
},
};