Skip to content

armgit / clipy

Public Imported from GitHub
0

The AI-native screen recorder. Record your screen and talk; the people you share it with and your AI agents both get it.

1.0 KB
Raw Blame
#!/usr/bin/env bash
set -euo pipefail

DESKTOP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
TAURI_DIR="$DESKTOP_DIR/src-tauri"

if [ "$(uname)" != "Darwin" ]; then
  echo "scripts/test-rust.sh sets up macOS only. For Windows and Linux, see \"Test it\" in desktop/README.md." >&2
  exit 1
fi

FFMPEG_LIB_DIR="$TAURI_DIR/target/native-deps/Spacedrive.framework/Libraries"

if [ ! -d "$FFMPEG_LIB_DIR" ]; then
  (
    cd "$DESKTOP_DIR"
    pnpm run setup:native-deps
  )
fi

if [ ! -d "$FFMPEG_LIB_DIR" ]; then
  echo "Missing native FFmpeg libraries: $FFMPEG_LIB_DIR" >&2
  exit 1
fi

export DYLD_FALLBACK_LIBRARY_PATH="$FFMPEG_LIB_DIR${DYLD_FALLBACK_LIBRARY_PATH:+:$DYLD_FALLBACK_LIBRARY_PATH}"

if ! /usr/bin/xcodebuild -version >/dev/null 2>&1; then
  SHIM_DIR="$TAURI_DIR/target/xcodebuild-shim"
  mkdir -p "$SHIM_DIR"
  cat > "$SHIM_DIR/xcodebuild" <<EOF
#!/bin/bash
exec /bin/bash "$DESKTOP_DIR/scripts/xcodebuild-cidre-shims.sh" "\$@"
EOF
  chmod +x "$SHIM_DIR/xcodebuild"
  export PATH="$SHIM_DIR:$PATH"
fi

cd "$TAURI_DIR"
cargo test "$@"