add support for dotfiles repos (#25)

* initial tests for dotfiles

* fix order

* first attempt at dotfiles magic

* trigger rebuild

* fix symlink?

* fix symlink again

* another weird fix

* another test

* fix symlink this time?

* fix
This commit is contained in:
Ben Potter
2021-04-27 22:40:16 -04:00
committed by GitHub
parent 4797d0efc8
commit 1973128317
3 changed files with 45 additions and 19 deletions

View File

@@ -76,6 +76,26 @@ else
fi
# Extract the user's dotfiles, if they exist
if [[ -z "${DOTFILES_REPO}" ]]; then
echo "[$PREFIX] DOTFILES_REPO is not specified"
else
echo "[$PREFIX] DOTFILES_REPO is specified"
git clone $DOTFILES_REPO /home/coder/dotfiles
# Symlink if install.sh doesn't exist.
# If it exits, run it
if [ -f "/home/coder/dotfiles/install.sh" ]; then
echo "[$PREFIX] install.sh exists, running it..."
/bin/sh /home/coder/dotfiles/install.sh
else
echo "[$PREFIX] install.sh does not exist, symlinking dotfiles..."
ln -sv /home/coder/dotfiles/* ~/
fi
fi
echo "[$PREFIX] Starting code-server..."
# Now we can run code-server with the default entrypoint
/usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 $START_DIR