From 3cbd356a63e4449474a6c1e3d9d4c1c4a9ffdf5e Mon Sep 17 00:00:00 2001 From: tee8z Date: Fri, 27 Dec 2024 14:47:20 -0500 Subject: [PATCH] fixing mac install for UI (#100) --- Cargo.lock | 4 ++-- doppler/Cargo.toml | 2 +- doppler_ui/dist.cjs | 18 +++++++++++------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86d2f6d..abb8077 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -403,7 +403,7 @@ dependencies = [ [[package]] name = "doppler" -version = "0.3.5" +version = "0.3.6" dependencies = [ "anyhow", "base64", diff --git a/doppler/Cargo.toml b/doppler/Cargo.toml index b71e5d4..2e479d8 100644 --- a/doppler/Cargo.toml +++ b/doppler/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "doppler" -version = "0.3.5" +version = "0.3.6" repository = "https://github.com/tee8z/doppler.git" [package.metadata.dist] diff --git a/doppler_ui/dist.cjs b/doppler_ui/dist.cjs index 4ce1f76..354b564 100644 --- a/doppler_ui/dist.cjs +++ b/doppler_ui/dist.cjs @@ -1,6 +1,7 @@ //used in build process please do not touch const { bin } = require('./package.json'); const execSync = require('child_process').execSync; +const os = require('os'); const path = require('path'); const fs = require('fs'); const crypto = require('crypto'); @@ -53,14 +54,17 @@ if (!bunTarget) { throw `To the best of our knowledge, bun does not support building for ${distTarget}`; } const binExt = distTarget.includes('windows') ? '.exe' : ''; -const isDarwin = distTarget.includes('apple-darwin'); -// Existing build process... +const isDarwin = process.platform === 'darwin'; + if (isDarwin) { - console.log('Darwin detected. Installing @rollup/rollup-darwin-x64...'); - execSync('npm install @rollup/rollup-darwin-x64', { stdio: 'inherit' }); - console.log('Removing old installed dependencies ...'); - execSync('rm package-lock.json', { stdio: 'inherit' }); - execSync('rm -rf node_modules', { stdio: 'inherit' }); + console.log('Darwin platform detected. Installing required dependencies...'); + try { + console.log('Installing @rollup/rollup-darwin-x64...'); + execSync('npm install --save @rollup/rollup-darwin-x64', { stdio: 'inherit' }); + } catch (error) { + console.error('Error during Darwin setup:', error); + process.exit(1); + } } // Setup npm