2024-03-20 19:52:03 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
THIS="$0"
|
|
|
|
function log {
|
|
|
|
printf "[%s] %s\n\n" "$THIS" "$*"
|
|
|
|
}
|
|
|
|
|
2024-04-04 12:56:56 +03:00
|
|
|
ROOT="$(dirname "$THIS")/../.."
|
|
|
|
TARGET_ROOT="$ROOT/target/release"
|
|
|
|
CRATE_ROOT="$ROOT/crates/gitbutler-tauri"
|
2024-03-22 00:19:33 +03:00
|
|
|
|
2024-04-04 12:56:56 +03:00
|
|
|
if [ -f "$TARGET_ROOT/gitbutler-git-askpass" ] && [ -f "$TARGET_ROOT/gitbutler-git-setsid" ]; then
|
2024-03-22 00:19:33 +03:00
|
|
|
TRIPLE="$(rustc -vV | sed -n 's|host: ||p')"
|
2024-04-04 12:56:56 +03:00
|
|
|
log injecting gitbutler-git binaries into crates/gitbutler-tauri "(TRIPLE=${TRIPLE})"
|
|
|
|
cp -v "$TARGET_ROOT/gitbutler-git-askpass" "$CRATE_ROOT/gitbutler-git-askpass-${TRIPLE}"
|
|
|
|
cp -v "$TARGET_ROOT/gitbutler-git-setsid" "$CRATE_ROOT/gitbutler-git-setsid-${TRIPLE}"
|
|
|
|
elif [ -f "$TARGET_ROOT/gitbutler-git-askpass.exe" ] && [ -f "$TARGET_ROOT/gitbutler-git-setsid.exe" ]; then
|
2024-03-22 00:19:33 +03:00
|
|
|
TRIPLE="$(rustc.exe -vV | sed -n 's|host: ||p')"
|
2024-04-04 12:56:56 +03:00
|
|
|
log injecting gitbutler-git binaries into crates/gitbutler-tauri "(TRIPLE=${TRIPLE})"
|
|
|
|
cp -v "$TARGET_ROOT/gitbutler-git-askpass.exe" "$CRATE_ROOT/gitbutler-git-askpass-${TRIPLE}.exe"
|
|
|
|
cp -v "$TARGET_ROOT/gitbutler-git-setsid.exe" "$CRATE_ROOT/gitbutler-git-setsid-${TRIPLE}.exe"
|
2024-03-22 00:19:33 +03:00
|
|
|
else
|
2024-03-20 19:52:03 +03:00
|
|
|
log gitbutler-git binaries are not built
|
|
|
|
exit 1
|
|
|
|
fi
|