diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bfc45f0..c3050a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: types: - opened - reopened - - syncronize + - synchronize push: # branches: # - master @@ -29,7 +29,7 @@ jobs: formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout/@v4 + - uses: actions/checkout@v4 - name: Install dependencies run: | npm install prettier prettier-plugin-sh --save-dev @@ -89,7 +89,7 @@ jobs: name: 'macOS (brew)' runs-on: macOS-latest steps: - - uses: actions/checkout/@v4 + - uses: actions/checkout@v4 - name: Install basicswap-bash run: | ./basicswap-install.sh --new --tor --internal --regtest diff --git a/bsx/addcoin.sh b/bsx/addcoin.sh index f0310da..bdfc25d 100755 --- a/bsx/addcoin.sh +++ b/bsx/addcoin.sh @@ -22,9 +22,13 @@ manage_daemon_false() { ## Remote node detect_os_arch -if [[ -z "${MACOS}" ]] && ! [[ "${local_only[@]}" =~ "${addcoin}" ]]; then +if ! [[ "${local_only[@]}" =~ "${addcoin}" ]]; then # Set wallet name - ticker="${coin_map[$addcoin]}" + if [[ "${MACOS}" ]]; then + ticker="$(get_coin_ticker "${addcoin}")" + else + ticker="${coin_map[$addcoin]}" + fi wallet_env="${ticker}_WALLET_NAME" wallet_name="BSX_${ticker}" diff --git a/bsx/shared.sh b/bsx/shared.sh index da4d8f9..a59499e 100755 --- a/bsx/shared.sh +++ b/bsx/shared.sh @@ -54,6 +54,24 @@ if [[ -z "${MACOS}" ]]; then ) fi +# Coin map (Bash 3.2 compatible for MacOS) +get_coin_ticker() { + case "$1" in + bitcoin) echo "BTC" ;; + bitcoincash) echo "BCH" ;; + dash) echo "DASH" ;; + decred) echo "DCR" ;; + dogecoin) echo "DOGE" ;; + firo) echo "FIRO" ;; + litecoin) echo "LTC" ;; + monero) echo "XMR" ;; + namecoin) echo "NMC" ;; + pivx) echo "PIVX" ;; + wownero) echo "WOW" ;; + *) red "Invalid coin \"$1\"" && exit 1 ;; + esac +} + # Activate venv activate_venv() { source $SWAP_DATADIR/venv/bin/activate @@ -172,7 +190,7 @@ detect_os_arch() { green "Installing Homebrew" INSTALL="curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | /bin/bash && brew install" fi - DEPENDENCY="python gnupg pkg-config coreutils" + DEPENDENCY="python gnupg pkg-config coreutils zeromq" green "\n\nDetected MacOS" elif type -p dnf > /dev/null; then # Fedora