26 lines
798 B
Bash
Executable File
26 lines
798 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
case "$(uname -s)" in
|
|
Darwin) ;;
|
|
*) echo "wrong platform: $(uname -s) — use cargo xtask install" >&2; exit 1;;
|
|
esac
|
|
|
|
INSTALL_DIR="$HOME/Documents/KiCad/10.0/plugins/com.jesshunter.layers"
|
|
|
|
bash "$ROOT/scripts/macos/build.sh"
|
|
|
|
rm -rf "$INSTALL_DIR/bin" "$INSTALL_DIR/resources" "$INSTALL_DIR/plugin.json" "$INSTALL_DIR/LICENCE"
|
|
mkdir -p "$INSTALL_DIR/bin" "$INSTALL_DIR/resources"
|
|
|
|
STAGE="$ROOT/build/bin/com.jesshunter.layers"
|
|
cp -R "$STAGE/bin/Layers.app" "$INSTALL_DIR/bin/Layers.app"
|
|
cp "$STAGE/plugin.json" "$INSTALL_DIR/plugin.json"
|
|
cp -R "$STAGE/resources/." "$INSTALL_DIR/resources/"
|
|
[ -f "$STAGE/LICENCE" ] && cp "$STAGE/LICENCE" "$INSTALL_DIR/LICENCE"
|
|
|
|
echo "installed: $INSTALL_DIR"
|