Skip to content

Commit 602529d

Browse files
committed
user relative paths for env provisioner files
1 parent 76eb5a4 commit 602529d

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

provision/core/env/provision.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env bash
22
set -eo pipefail
33

4+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
5+
46
# @description Adds the homebin folder to PATH
57
# @noargs
68
function setup_vvv_env() {
@@ -60,7 +62,7 @@ function cleanup_terminal_splash() {
6062
if [[ -f /etc/update-motd.d/00-vvv-bash-splash ]]; then
6163
rm /etc/update-motd.d/00-vvv-bash-splash
6264
fi
63-
cp -f "/srv/provision/core/env/motd/00-vvv-bash-splash" "/etc/update-motd.d/00-vvv-bash-splash"
65+
cp -f "${DIR}/motd/00-vvv-bash-splash" "/etc/update-motd.d/00-vvv-bash-splash"
6466
chmod +x /etc/update-motd.d/00-vvv-bash-splash
6567
}
6668

@@ -71,26 +73,26 @@ function profile_setup() {
7173

7274
# Copy custom dotfiles and bin file for the vagrant user from local
7375
rm -f "/home/vagrant/.bash_profile"
74-
noroot cp -f "/srv/provision/core/env/homedir/.bash_profile" "/home/vagrant/.bash_profile"
76+
noroot cp -f "${DIR}/homedir/.bash_profile" "/home/vagrant/.bash_profile"
7577

7678
rm -f "/home/vagrant/.bash_aliases"
77-
noroot cp -f "/srv/provision/core/env/homedir/.bash_aliases" "/home/vagrant/.bash_aliases"
79+
noroot cp -f "${DIR}/homedir/.bash_aliases" "/home/vagrant/.bash_aliases"
7880

7981
rm -f "${HOME}/.bash_aliases"
80-
cp -f "/srv/provision/core/env/homedir/.bash_aliases" "${HOME}/.bash_aliases"
82+
cp -f "${DIR}/homedir/.bash_aliases" "${HOME}/.bash_aliases"
8183

8284
rm -f "/home/vagrant/.vimrc"
83-
noroot cp -f "/srv/provision/core/env/homedir/.vimrc" "/home/vagrant/.vimrc"
85+
noroot cp -f "${DIR}/homedir/.vimrc" "/home/vagrant/.vimrc"
8486

8587
if [[ ! -d "/home/vagrant/.subversion" ]]; then
8688
noroot mkdir -p "/home/vagrant/.subversion"
8789
fi
8890

8991
rm -f /home/vagrant/.subversion/servers
90-
noroot cp "/srv/provision/core/env/homedir/.subversion/subversion-servers" "/home/vagrant/.subversion/servers"
92+
noroot cp "${DIR}/homedir/.subversion/subversion-servers" "/home/vagrant/.subversion/servers"
9193

9294
rm -f /home/vagrant/.subversion/config
93-
noroot cp "/srv/provision/core/env/homedir/.subversion/subversion-config" "/home/vagrant/.subversion/config"
95+
noroot cp "${DIR}/homedir/.subversion/subversion-config" "/home/vagrant/.subversion/config"
9496

9597
# If a bash_prompt file exists in the VVV config/ directory, copy to the VM.
9698
if [[ -f "/srv/config/bash_prompt" ]]; then
@@ -99,8 +101,8 @@ function profile_setup() {
99101
fi
100102

101103
if [ -d "/etc/ssh" ]; then
102-
cp -f /srv/provision/core/env/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts
103-
cp -f /srv/provision/core/env/ssh/sshd_config /etc/ssh/sshd_config
104+
cp -f "${DIR}/ssh/ssh_known_hosts" /etc/ssh/ssh_known_hosts
105+
cp -f "${DIR}/ssh/sshd_config" /etc/ssh/sshd_config
104106
vvv_info " * Reloading SSH Daemon"
105107
if ! sudo service ssh reload; then
106108
vvv_error " ! SSH daemon failed to reload"

0 commit comments

Comments
 (0)