feat: Download windows cli archive in desktop
This commit is contained in:
1 parent
685ddeac7e
commit
bcf27ae048
3 files changed
+17
-3
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user