diff --git a/bin/shell.js b/bin/shell.js deleted file mode 100644 index 34fbfb1..0000000 --- a/bin/shell.js +++ /dev/null @@ -1,47 +0,0 @@ -import { execSync } from 'child_process'; -import logSymbols from 'log-symbols'; -import ora from 'ora'; -export function sourceShellConfig() { - const shell = execSync('echo $SHELL', { encoding: 'utf-8' }).trim(); - if (shell.includes('bash')) { - execSync('source ~/.bashrc', { stdio: 'inherit' }); - } - else if (shell.includes('zsh')) { - execSync(`zsh -c "source ~/.zshrc"`, { stdio: 'inherit' }); - } - else if (shell.includes('fish')) { - execSync(`fish -c "source ~/.config/fish/config.fish"`, { stdio: 'inherit' }); - } - else { - throw new Error('Unsupported shell environment'); - } -} -export function exec(cmd, options = {}) { - return execSync(cmd, { - encoding: 'utf-8', - stdio: 'pipe', - ...options, - }); -} -const spinner = ora({ color: 'blue', discardStdin: false }); -export function installInstallers() { - try { - exec('which noirup', { stdio: 'ignore' }); - spinner.succeed('noirup is already installed'); - } - catch { - spinner.start('Installing noirup'); - exec('curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash'); - spinner.stopAndPersist({ symbol: logSymbols.success }); - } - try { - exec('which bbup', { stdio: 'ignore' }); - spinner.succeed('bbup is already installed'); - } - catch { - spinner.start('Installing bbup'); - exec('curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/master/barretenberg/cpp/installation/install | bash'); - spinner.stopAndPersist({ symbol: logSymbols.success }); - } - sourceShellConfig(); -} diff --git a/bin/versions.js b/bin/versions.js deleted file mode 100644 index 2303549..0000000 --- a/bin/versions.js +++ /dev/null @@ -1,13 +0,0 @@ -import axios from 'axios'; -export async function getBbVersion(noirVersion) { - const url = `https://raw.githubusercontent.com/noir-lang/noir/v${noirVersion}/scripts/install_bb.sh`; - try { - const { data } = await axios.get(url); - const versionMatch = data.match(/VERSION="([\d.]+)"/); - const version = versionMatch ? versionMatch[1] : null; - return version; - } - catch (e) { - throw new Error(e); - } -}