field_ios

In-the-field app for Radroots on iOS
git clone https://radroots.dev/git/field_ios.git
Log | Files | Refs | README | LICENSE

swift-package.sh (665B)


      1 #!/bin/sh
      2 set -eu
      3 
      4 for variable in SWIFTPM_SCRATCH SWIFTPM_CACHE; do
      5     case "$variable" in
      6         SWIFTPM_SCRATCH) value=${SWIFTPM_SCRATCH:-} ;;
      7         SWIFTPM_CACHE) value=${SWIFTPM_CACHE:-} ;;
      8     esac
      9     if [ -z "$value" ]; then
     10         echo "error: $variable is required; run this command through cargo extbuild" >&2
     11         exit 1
     12     fi
     13 done
     14 
     15 operation=${1:-}
     16 case "$operation" in
     17     resolve)
     18         exec swift package \
     19             --scratch-path "$SWIFTPM_SCRATCH" \
     20             --cache-path "$SWIFTPM_CACHE" \
     21             --disable-sandbox \
     22             resolve
     23         ;;
     24     *)
     25         echo "usage: $0 resolve" >&2
     26         exit 64
     27         ;;
     28 esac