-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add leo installation to create aleo app (#757)
Co-authored-by: Collin Chin <[email protected]>
- Loading branch information
1 parent
5d78f43
commit f7753d1
Showing
2 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# script exists immediately if command fails | ||
set -e | ||
|
||
# check for dependencies | ||
command -v git >/dev/null 2>&1 || { echo >&2 "git is required but it's not installed. Aborting."; exit 1; } | ||
command -v cargo >/dev/null 2>&1 || { echo >&2 "cargo is required but it's not installed. Aborting."; exit 1; } | ||
|
||
INSTALL_DIR="${INSTALL_DIR:-$HOME/.leo}" | ||
|
||
# ask for confirmation | ||
read -p "This script will install Leo into $INSTALL_DIR. Do you want to continue? (y/N) " choice | ||
case "$choice" in | ||
y|Y ) echo "Continuing installation...";; | ||
* ) echo "Aborting."; exit;; | ||
esac | ||
|
||
# clone or update the repo | ||
if [ -d "$INSTALL_DIR" ]; then | ||
echo "Directory $INSTALL_DIR exists. Updating repository..." | ||
git -C "$INSTALL_DIR" pull | ||
else | ||
echo "Cloning repository into $INSTALL_DIR..." | ||
git clone https://github.com/AleoHQ/leo "$INSTALL_DIR" | ||
fi | ||
|
||
# build and install | ||
echo "Building and installing from source..." | ||
cargo install --path "$INSTALL_DIR" |
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