VR-25/tarb

Does not run shell properly on MacOS

sealad886 opened this issue · 2 comments

Trying to run the build.sh and tarb.sh shell scripts fails due to how MacOS interprets sed command; requires backup file extension as first command.

% bash -x ./build.sh arm64

  • echo

  • set -eu

  • sh -n tarb.sh

  • TMPDIR=build
    ++ awk '/^#binaries.tgz.base64/ { print NR + 1; exit 0; }' tarb.sh

  • BIN_LINE=1142

  • offline=false

  • '[' .arm64 '!=' .o ']'
    ++ head -n1 CHANGELOG

  • ver='v2023.10.22 202310220'

  • echo 'v2023.10.22 202310220'

  • cut -d ' ' -f 2

  • sed -i '/^VERSION=/s/=.*/="v2023.10.22 202310220"/' tarb.sh
    sed: 1: "tarb.sh": undefined label 'arb.sh'

To fix this, simply find-and-replace in both build.sh and tarb.sh files:
sed -i
-->. sed -i ""
such that the first arg is "" after -i. If you don't have a trailing space after either in your find-and-replace, then your arguments line up perfectly for how MacOS expects this to work and the shell scripts will run correctly.