fix: 🐛 Fix client daemon usage on windows (#2115)
* fix: 🐛 Fix client daemon usage on windows ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12365 * refactor: 💡 Fix error handling ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-12365 --------- Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
This commit is contained in:
1 parent
8f34d83c15
commit
3721f63edf
4 files changed
+102
-16
No files matched your search
@@ -13,9 +13,9 @@ module.exports = {
|
||||
// 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);
|
||||
const { stdout } = spawnSync(command);
|
||||
let gitRevision = /Git Revision:\s*(?<rev>.*)\n/.exec(stdout);
|
||||
let versionNumber = /Version Number:\s*(?<ver>.*)\n/.exec(stdout);
|
||||
if (gitRevision) gitRevision = gitRevision.groups.rev;
|
||||
if (versionNumber) versionNumber = versionNumber.groups.ver;
|
||||
const formatted = versionNumber
|
||||
|
||||
Reference in new issue
Block a user