-
Notifications
You must be signed in to change notification settings - Fork 2
/
init
executable file
·41 lines (32 loc) · 1.09 KB
/
init
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
#!/bin/bash
echo "This will run on sharing.io humacs init"
echo "~/.sharing.io/init START"
cd $(dirname $0)
GIT_ROOT=$(git rev-parse --show-toplevel)
cd $GIT_ROOT
if ! git remote -v | grep -q https://github.com/sharingio/.sharing.io; then
git remote add upstream https://github.com/sharingio/.sharing.io
fi
cat ${PWD}/.bashrc++ >> ${HOME}/.bashrc
# Override in your forks
export TMATE_SOCKET="${TMATE_SOCKET:-/tmp/ii.default.target.iisocket}"
echo "~/.sharing.io/init Waiting for tmate socket: $TMATE_SOCKET"
/usr/local/bin/tmate-wait-for-socket.sh
(
set -a
. /etc/os-release
[ "$ID_LIKE" = "debian" ] && \
sudo apt-wait && \
sudo apt update
) &
docker pull alpine:edge &
if [ -x "$GIT_ROOT/users/${SHARINGIO_PAIR_USER:-$USER}/init" ] ; then
(
cd $INIT_DEFAULT_REPOS_FOLDER
$GIT_ROOT/users/${SHARINGIO_PAIR_USER:-$USER}/init &
)
fi
echo "~/.sharing.io/init Creating tmate SHELL window"
# without it, there is only emacs, hard for new users
tmate -F -v -S $TMATE_SOCKET new-window -d -c "$HOME" -n SHELL bash
# Feel free to customize the startup beyond here