Skip to content

Commit

Permalink
Move relauncher shell script
Browse files Browse the repository at this point in the history
  • Loading branch information
mtsgrd committed Sep 7, 2024
1 parent a61d677 commit 50c18f0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
3 changes: 3 additions & 0 deletions crates/gitbutler-tauri/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ gen/

# Extra binaries, figure out why they end up in this directory on build.
gitbutler-git-*

# Injected for Tauri v1 -> v2 upgrade, remove when no longer needed.
./GitButler*
7 changes: 0 additions & 7 deletions crates/gitbutler-tauri/files/relauncher

This file was deleted.

7 changes: 5 additions & 2 deletions crates/gitbutler-tauri/inject-relauncher.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
# Injects the relauncher into the right place with the correct platform
# information. It is only needed for macos, but there is no way to restrict
# "externalBin" in the turi configuration to a specific platform.
set -euo pipefail

THIS="$0"
Expand All @@ -14,7 +17,7 @@ CRATE_ROOT="$ROOT/crates/gitbutler-tauri"

log injecting relauncher into crates/gitbutler-tauri "(TRIPLE=${TRIPLE})"
if ! [[ $TRIPLE =~ "windows" ]]; then
cp -v "$CRATE_ROOT/files/relauncher" "$CRATE_ROOT/$RELAUNCHER-${TRIPLE}"
cp -v "$CRATE_ROOT/relauncher.sh" "$CRATE_ROOT/$RELAUNCHER-${TRIPLE}"
else
cp -v "$CRATE_ROOT/files/relauncher" "$CRATE_ROOT/$RELAUNCHER-${TRIPLE}.exe"
cp -v "$CRATE_ROOT/relauncher.sh" "$CRATE_ROOT/$RELAUNCHER-${TRIPLE}.exe"
fi
10 changes: 10 additions & 0 deletions crates/gitbutler-tauri/relauncher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# This relauncher is necessary for Tauri v1 -> v2 upgrades. The binary name
# has changed from e.g. `GitButler` to `gitbutler-tauri`, but on restarting
# the app the executable is expected to have the same path. This bash script
# is copied into the known location of the old binary name.

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# Line needs to be quoted since $SCRIPT_DIR contains spaces.
$SCRIPT_DIR/gitbutler-tauri

0 comments on commit 50c18f0

Please sign in to comment.