@@ -15,6 +15,13 @@ if [ ! -d "${HOME}/.config/containers" ]; then
15
15
fi
16
16
fi
17
17
18
+ # Create Sym Link for Composer Keys in /home/tooling/.config
19
+ if [ -d /home/tooling/.config/composer ] && [ ! -d " ${HOME} /.config/composer" ]; then
20
+ mkdir -p ${HOME} /.config/composer
21
+ ln -s /home/tooling/.config/composer/keys.dev.pub ${HOME} /.config/composer/keys.dev.pub
22
+ ln -s /home/tooling/.config/composer/keys.tags.pub ${HOME} /.config/composer/keys.tags.pub
23
+ fi
24
+
18
25
# Setup $PS1 for a consistent and reasonable prompt
19
26
if [ -w " ${HOME} " ] && [ ! -f " ${HOME} " /.bashrc ]; then
20
27
echo " PS1='[\u@\h \W]\$ '" > " ${HOME} " /.bashrc
30
37
31
38
source kubedock_setup
32
39
40
+ # Stow
41
+ # # Required for https://github.com/eclipse/che/issues/22412
42
+
43
+ # /home/user/ will be mounted to by a PVC if persistUserHome is enabled
44
+ mountpoint -q /home/user/; HOME_USER_MOUNTED=$?
45
+
46
+ # This file will be created after stowing, to guard from executing stow everytime the container is started
47
+ STOW_COMPLETE=/home/user/.stow_completed
48
+
49
+ if [ $HOME_USER_MOUNTED -eq 0 ] && [ ! -f $STOW_COMPLETE ]; then
50
+ # Create symbolic links from /home/tooling/ -> /home/user/
51
+ stow . -t /home/user/ -d /home/tooling/ --no-folding -v 2 > /tmp/stow.log 2>&1
52
+ # Vim does not permit .viminfo to be a symbolic link for security reasons, so manually copy it
53
+ cp /home/tooling/.viminfo /home/user/.viminfo
54
+ # We have to restore bash-related files back onto /home/user/ (since they will have been overwritten by the PVC)
55
+ # but we don't want them to be symbolic links (so that they persist on the PVC)
56
+ cp /home/tooling/.bashrc /home/user/.bashrc
57
+ cp /home/tooling/.bash_profile /home/user/.bash_profile
58
+ touch $STOW_COMPLETE
59
+ fi
60
+
33
61
exec " $@ "
0 commit comments