-
Notifications
You must be signed in to change notification settings - Fork 13
/
install.sh
executable file
·81 lines (64 loc) · 2.2 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/usr/bin/env bash
set -euo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
. ./constants.sh install
pushd "$REPO_ROOT/bin"
curl --fail -L "https://download.dfinity.systems/ic/${IC_COMMIT}/binaries/x86_64-${OS}/ic-admin.gz" -o ic-admin.gz
gzip -fd ic-admin.gz
chmod +x ic-admin
curl --fail -L "https://download.dfinity.systems/ic/${IC_COMMIT}/binaries/x86_64-${OS}/ic-nns-init.gz" -o ic-nns-init.gz
gzip -fd ic-nns-init.gz
chmod +x ic-nns-init
curl --fail -L "https://download.dfinity.systems/ic/${IC_COMMIT}/binaries/x86_64-${OS}/ic-regedit.gz" -o ic-regedit.gz
gzip -fd ic-regedit.gz
chmod +x ic-regedit
curl --fail -L "https://download.dfinity.systems/ic/${IC_COMMIT}/binaries/x86_64-${OS}/sns.gz" -o sns.gz
gzip -fd sns.gz
chmod +x sns
curl --fail -L "https://github.com/dfinity/sdk/releases/download/${DFX_VERSION}/dfx-${DFX_VERSION}-x86_64-${OS}.tar.gz" -o dfx.tar.gz
tar -xzf dfx.tar.gz
rm dfx.tar.gz
chmod +x dfx
if [[ "${OS}" == "linux" ]]
then
export QUILL_PLATFORM="linux"
export IC_WASM_PLATFORM="linux64"
elif [[ "${OS}" == "darwin" ]]
then
export QUILL_PLATFORM="macos"
export IC_WASM_PLATFORM="macos"
else
echo "Unknown OS!"
exit 1
fi
curl --fail -L "https://github.com/dfinity/quill/releases/download/v${QUILL_VERSION}/quill-${QUILL_PLATFORM}-x86_64" -o quill
chmod +x quill
curl --fail -L "https://github.com/dfinity/ic-wasm/releases/download/${IC_WASM_VERSION}/ic-wasm-${IC_WASM_PLATFORM}" -o ic-wasm
chmod +x ic-wasm
if [[ "${OS}" == "linux" ]]
then
export DIDC="linux64"
elif [[ "${OS}" == "darwin" ]]
then
export DIDC="macos"
else
echo "Unknown OS!"
exit 1
fi
curl --fail -L "https://github.com/dfinity/candid/releases/download/2022-11-17/didc-${DIDC}" -o didc
chmod +x didc
if [[ "${OS}" == "linux" ]]
then
curl --fail -L "https://github.com/dfinity/idl2json/releases/download/v0.8.8/idl2json_cli-x86_64-unknown-linux-musl.tar.gz" -o idl2json.tar.gz
tar -xzf idl2json.tar.gz
rm idl2json.tar.gz
chmod +x idl2json
else
curl --fail -L "https://github.com/dfinity/idl2json/releases/download/v0.8.8/idl2json_cli-x86_64-apple-darwin.zip" -o idl2json.zip
unzip idl2json.zip
rm idl2json.zip
chmod +x idl2json
fi
# Add $REPO_ROOT/bin to path
export PATH="$(readlink -f .):${PATH}"
popd