chore: look for binary within the app bundle instead of the system path
This commit is contained in:
2 files changed
+8
-4
No files matched your search
@@ -1,7 +1,7 @@
|
||||
const { lookpath } = require('lookpath');
|
||||
const path = require('path');
|
||||
const spawnPromise = require('./spawn-promise');
|
||||
|
||||
const cliPath = async () => await lookpath('boundary');
|
||||
const cliPath = async () => path.resolve(__dirname, 'binary', 'boundary');
|
||||
|
||||
module.exports = {
|
||||
// Find boundary cli path
|
||||
@@ -17,7 +17,7 @@ module.exports = {
|
||||
`-addr=${addr}`,
|
||||
'-format=json',
|
||||
'--output-json-errors'
|
||||
]
|
||||
];
|
||||
return spawnPromise(command);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
const path = require('path');
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
// Convert to json
|
||||
@@ -26,7 +27,10 @@ const jsonify = (data) => {
|
||||
// POJO representation and throw it or promise->reject it.
|
||||
module.exports = function spawnPromise (command) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const childProcess = spawn('boundary', command);
|
||||
const boundaryPath = path.resolve(__dirname, 'binary', 'boundary');
|
||||
// TODO: remove path logging
|
||||
console.log(boundaryPath);
|
||||
const childProcess = spawn(boundaryPath, command);
|
||||
let outputStream = '';
|
||||
let errorStream = '';
|
||||
|
||||
|
||||
Reference in new issue
Block a user