This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
82 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,53 @@ | ||
#!/bin/bash | ||
|
||
rm -rf src-tauri/bins/ | ||
mkdir src-tauri/bins | ||
REQUIRED_HOLOCHAIN_VERSION="0.2.3-beta-rc.1" | ||
REQUIRED_LAIR_VERSION="0.3.0" | ||
|
||
# Check that this script is being run from the right location | ||
if [ ! -f "package.json" ] || [ ! -f "src-tauri/tauri.conf.json" ]; | ||
then | ||
echo "Error: You must run this script in the root directory of the launcher repository." | ||
exit 1 | ||
fi | ||
|
||
# Check wheter cargo is available | ||
if [ ! command -v cargo &> /dev/null ] || [ ! command -v rustc &> /dev/null ]; | ||
then | ||
echo "Error: You need to install Rust first." | ||
exit 1 | ||
fi | ||
|
||
# get target architecture triple, e.g. unknown-linux-gnu on Ubuntu 22.04 | ||
TARGET_TRIPLE=$(rustc -vV | sed -n 's/^.*host: \(.*\)*$/\1/p') | ||
|
||
HOLOCHAIN_PATH=$(which holochain) | ||
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-$TARGET_TRIPLE | ||
# create src-tauri/bins if id doesn't exist | ||
if [ ! -d src-tauri/bins ]; | ||
then mkdir src-tauri/bins | ||
fi | ||
|
||
# check whether correct holochain binary is already in the src-tauri/bins folder | ||
if [ -f "src-tauri/bins/holochain-v${REQUIRED_HOLOCHAIN_VERSION}-$TARGET_TRIPLE" ]; | ||
then echo "Required holochain binary already installed." | ||
else | ||
echo "Installing required holochain binary from crates.io" | ||
echo "Running command 'cargo install holochain --version $REQUIRED_HOLOCHAIN_VERSION --locked --features sqlite-encrypted'" | ||
cargo install holochain --version $REQUIRED_HOLOCHAIN_VERSION --locked --features sqlite-encrypted | ||
echo "Copying holochain binary to src-tauri/bins folder." | ||
HOLOCHAIN_PATH=$(which holochain) | ||
cp $HOLOCHAIN_PATH src-tauri/bins/holochain-v${REQUIRED_HOLOCHAIN_VERSION}-$TARGET_TRIPLE | ||
fi | ||
|
||
# check whether correct lair binary is already in the src-tauri/bins folder | ||
if [ -f "src-tauri/bins/lair-keystore-v${REQUIRED_LAIR_VERSION}-${TARGET_TRIPLE}" ]; | ||
|
||
then echo "Required lair-keystore binary already installed." | ||
else | ||
echo "Installing required lair-keystore binary from crates.io" | ||
echo "Running command 'cargo install lair-keystore --version $REQUIRED_LAIR_VERSION --locked'" | ||
cargo install lair_keystore --version $REQUIRED_LAIR_VERSION --locked | ||
echo "Copying lair-keystore binary to src-tauri/bins folder." | ||
LAIR_PATH=$(which lair-keystore) | ||
cp $LAIR_PATH src-tauri/bins/lair-keystore-v${REQUIRED_LAIR_VERSION}-$TARGET_TRIPLE | ||
fi | ||
|
||
LAIR_PATH=$(which lair-keystore) | ||
cp $LAIR_PATH src-tauri/bins/lair-keystore-$TARGET_TRIPLE | ||
echo "done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters