-
Notifications
You must be signed in to change notification settings - Fork 6
/
install.sh
executable file
·39 lines (30 loc) · 1.17 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh
bin_dir=$HOME/.jinko/bin
lib_dir=$HOME/.jinko/libs
echo "Setting up standard library..."
mkdir -p $bin_dir
mkdir -p $lib_dir
set -e
# If the stdlib folder does not exist, we want to error out immediately
cp -r stdlib $lib_dir
echo "Installing jinko binary..."
# FIXME: Later on, this should check if jinko is already installed or if this installation
# truly is a version upgrade.
# It would also be nice if this script was written directly in jinko... ;)
# If a Cargo.toml file is present in the current folder, then we are installing from
# source. Simply run cargo install and setup the jinko environment
if [ -f Cargo.toml ]; then
echo "Compiling jinko from source... "
# Force install to force update any existing jinko installation
cargo build --release
echo -n "jinko --version: "
target/release/jinko -v
cp target/release/jinko $bin_dir
else
echo -n "Installing jinko from a release... "
jinko --version
# We assume that a binary named jinko exists in the current directory. Otherwise, this
# is a very erroneous state.
cp jinko $bin_dir
fi
echo -e "\e[95mjinko\e[0m is installed! Remember to add '$HOME/.jinko/bin/' to your path"