-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·31 lines (25 loc) · 792 Bytes
/
setup.sh
File metadata and controls
executable file
·31 lines (25 loc) · 792 Bytes
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
#!/bin/bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
function log {
echo "[$(date +'%F %T')] $*"
}
# Set up our .zshrc, replacing if it exists.
for file in bashrc zshrc
do
log "Copying .${file}"
cp -f "./${file}" "$HOME/.${file}"
done
# Try to find the checked out repo root
# In gitpod we have an environment variable. In coder, it's just ~/picnic.
WORKSPACE="${GITPOD_REPO_ROOT:-$HOME/picnic}"
if ! test -d "$WORKSPACE"
then
>&2 echo "Workspace root value $WORKSPACE does not refer to a directory"
exit 0
fi
# Copy docker-compose.override.yml if not present
log "Copying docker-compose.override.yml (if not present)"
test -f "$WORKSPACE/docker-compose.override.yml" ||
cp -v "./docker-compose.override.yml" "$WORKSPACE/docker-compose.override.yml"
log "Done"