diff --git a/ui/desktop/electron-app/config/cli.js b/ui/desktop/electron-app/config/cli.js index 9ebc26ea7..3b106ce7b 100644 --- a/ui/desktop/electron-app/config/cli.js +++ b/ui/desktop/electron-app/config/cli.js @@ -7,8 +7,17 @@ const os = require('os'); const artifactVersion = '0.2.0'; const artifactDestination = path.resolve(__dirname, '..', 'cli'); +const platform = { + name: 'darwin', + arch: 'amd64', +}; +if(os.type().match(/(windows)/i)) { + platform.name = 'windows'; + arch = 'amd64'; +} + const downloadArtifact = version => { - const url = `https://releases.hashicorp.com/boundary/${version}/boundary_${version}_darwin_amd64.zip`; + const url = `https://releases.hashicorp.com/boundary/${version}/boundary_${version}_${platform.name}_${platform.arch}.zip`; return new Promise((resolve, reject) => { const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'boundary-artifact-')); console.log('Create tmp artifact directory: ', tmpDir); diff --git a/ui/desktop/electron-app/package.json b/ui/desktop/electron-app/package.json index d9df381c8..e8622d0f0 100644 --- a/ui/desktop/electron-app/package.json +++ b/ui/desktop/electron-app/package.json @@ -8,7 +8,7 @@ "author": "HashiCorp", "main": "src/index.js", "scripts": { - "build:cli": "node -e 'require(\"./config/cli.js\").setup()'", + "build:cli": "node -e \"require('./config/cli.js').setup()\"", "start": "electron-forge start", "package": "electron-forge package", "premake": "yarn build:cli", diff --git a/ui/desktop/electron-app/src/cli/index.js b/ui/desktop/electron-app/src/cli/index.js index 0aaad4e31..cbcd24010 100644 --- a/ui/desktop/electron-app/src/cli/index.js +++ b/ui/desktop/electron-app/src/cli/index.js @@ -1,7 +1,12 @@ const path = require('path'); +const os = require('os'); const { spawnSync } = require('../helpers/spawn-promise.js'); -const cliPath = async () => path.resolve(__dirname, '..', '..', 'cli', 'boundary'); +const cliPath = async () => { + let cli = 'boundary'; + if(os.type().match(/(windows)/i)) cli = 'boundary.exe'; + return path.resolve(__dirname, '..', 'cli', cli); +} module.exports = { // Check boundary cli existence