forked from DecentralCardGame/Cardchain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ignite
executable file
·36 lines (27 loc) · 886 Bytes
/
ignite
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
#!/usr/bin/env sh
# Ingite wrapper to ensure ignite version compatibility
# Takes optional `--path <path>` option to specify an ingite installation at a different location then the default one
# All other arguments are passed on to ignite
IGNITE_VERSION="v0.25.2"
if [[ $1 == "--path" ]]; then
path=$2
if ! [ -f $path ]; then
echo "[Wrapper] Path '$path' was not found"
exit 1
fi
args=${@:3}
else
path=$(which ignite)
if [[ $? != 0 ]]; then
echo "[Wrapper] Error: No ignite binary found"
exit 1
fi
args=$@
fi
version=$($path version | grep -E "Ignite CLI version:" | awk '{print $NF}')
if [[ $version != $IGNITE_VERSION ]]; then
echo "[Wrapper] Error: No matching ignite version found, required is $IGNITE_VERSION but $version was found"
exit 1
fi
echo "[Wrapper] Using $path $IGNITE_VERSION"
$path $args