1
0

test.sh 572 B

1234567891011121314151617181920
  1. #!/bin/zsh
  2. #
  3. # A `realpath` alternative using the default C implementation.
  4. filepath() {
  5. [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
  6. }
  7. OPENSWIFTUI_ROOT="$(dirname $(dirname $(filepath $0)))"
  8. cd $OPENSWIFTUI_ROOT
  9. # Set OPENSWIFTUI_LIB_SWIFT_PATH on Linux if swiftly is installed
  10. if [[ "$(uname)" == "Linux" ]] && command -v swiftly &> /dev/null && [[ -z "$OPENSWIFTUI_LIB_SWIFT_PATH" ]]; then
  11. export OPENSWIFTUI_LIB_SWIFT_PATH="$(swiftly use --print-location)/usr/lib/swift"
  12. echo "Set OPENSWIFTUI_LIB_SWIFT_PATH=$OPENSWIFTUI_LIB_SWIFT_PATH"
  13. fi
  14. swift test