-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinstall.sh
executable file
·42 lines (32 loc) · 973 Bytes
/
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
#!/bin/bash
ROOT=$(dirname $(readlink -f $0))
HAXE_VER=$(cat $ROOT/res/.current)
mkdir -p "$ROOT/releases"
mkdir -p "$ROOT/versions"
mkdir -p "$ROOT/bin"
# Install cli launcher
cp res/hx bin/
cp res/hxlib bin/
BUILD_OS="linux64"
if [[ "$OSTYPE" == "darwin"* ]]; then
BUILD_OS="mac"
fi
# Setup included Haxe version
if ! [ -L "versions/5.0.0-alpha.1+$HAXE_VER" ]; then
ln -s "$ROOT/res/${BUILD_OS}_$HAXE_VER" "versions/5.0.0-alpha.1+$HAXE_VER"
fi
if ! [ -L "current" ]; then
ln -s "$ROOT/res/${BUILD_OS}_${HAXE_VER}" "current"
fi
# Expose haxe command
if ! [ -L "bin/haxe" ]; then
ln -s ../current/haxe bin/haxe
fi
# Expose haxelib command
if ! [ -L "bin/haxelib" ]; then
ln -s ../current/haxelib bin/haxelib
fi
# Prebuild cli
HAXE_STD_PATH="$ROOT/res/${BUILD_OS}_${HAXE_VER}/std/" "$ROOT/res/${BUILD_OS}_${HAXE_VER}/haxe" --cwd "$ROOT" build.hxml --hxb res/hx.hxb
echo "Please add $ROOT/bin to your PATH"
echo "Please set HAXE_STD_PATH to $ROOT/current/std"