-
Notifications
You must be signed in to change notification settings - Fork 2
/
stella-link.sh
executable file
·43 lines (41 loc) · 1.28 KB
/
stella-link.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
#!/usr/bin/env bash
_STELLA_LINK_CURRENT_FILE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
[ -f "$_STELLA_LINK_CURRENT_FILE_DIR/.stella-id" ] && . $_STELLA_LINK_CURRENT_FILE_DIR/.stella-id
[ ! "$1" = "chaining" ] && export STELLA_APP_ROOT=$_STELLA_LINK_CURRENT_FILE_DIR
if [ ! "$1" = "nothing" ]; then
if [ ! "$1" = "bootstrap" ]; then
if [ ! -f "$STELLA_ROOT/stella.sh" ]; then
if [ -f "$(dirname $_STELLA_LINK_CURRENT_FILE_DIR)/stella-link.sh" ]; then
echo " ** Try to chain link stella from $(dirname $_STELLA_LINK_CURRENT_FILE_DIR)"
. $(dirname $_STELLA_LINK_CURRENT_FILE_DIR)/stella-link.sh chaining
else
echo "** WARNING Stella is missing -- bootstraping stella"
$_STELLA_LINK_CURRENT_FILE_DIR/stella-link.sh bootstrap
fi
fi
fi
fi
ACTION=$1
case $ACTION in
include)
. "$STELLA_ROOT/conf.sh"
__init_stella_env
;;
env)
. "$STELLA_ROOT/conf.sh"
__init_stella_env
echo "** Current env is setted/refreshed with stella env"
;;
bootstrap)
cd "$_STELLA_LINK_CURRENT_FILE_DIR"
curl -sSL https://raw.githubusercontent.com/StudioEtrange/stella/master/nix/pool/stella-bridge.sh -o stella-bridge.sh
chmod +x stella-bridge.sh
./stella-bridge.sh bootstrap
rm -f stella-bridge.sh
;;
nothing|chaining)
;;
*)
$STELLA_ROOT/stella.sh $*
;;
esac