summaryrefslogtreecommitdiff
path: root/deploy.sh
diff options
context:
space:
mode:
Diffstat (limited to 'deploy.sh')
-rwxr-xr-xdeploy.sh68
1 files changed, 34 insertions, 34 deletions
diff --git a/deploy.sh b/deploy.sh
index fb2d879..3b4afa0 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -1,44 +1,44 @@
#!/bin/sh
-# stolen from: https://github.com/rexim/dotfiles/blob/master/deploy.sh
+# forked from: https://github.com/rexim/dotfiles/blob/master/deploy.sh
SCRIPT_DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )"
-symlinkFile() {
- filename="$SCRIPT_DIR/$1"
- destination="$HOME/$2/$1"
-
- mkdir -p $(dirname "$destination")
-
- if [ ! -L "$destination" ]; then
- if [ -e "$destination" ]; then
- echo "[ERROR] $destination exists but it's not a symlink. Please fix that manually" && exit 1
- else
- ln -s "$filename" "$destination"
- echo "[OK] $filename -> $destination"
- fi
- else
- echo "[WARNING] $filename already symlinked"
- fi
+symlink_file() {
+ filename="$SCRIPT_DIR/$1"
+ destination="$HOME/$2/$1"
+
+ mkdir -p $(dirname "$destination")
+
+ if [ ! -L "$destination" ]; then
+ if [ -e "$destination" ]; then
+ echo "[ERROR] $destination exists but it's not a symlink. Please fix that manually" && exit 1
+ else
+ ln -s "$filename" "$destination"
+ echo "[OK] $filename -> $destination"
+ fi
+ else
+ echo "[WARNING] $filename already symlinked"
+ fi
}
-deployManifest() {
- for row in $(cat $SCRIPT_DIR/$1); do
- filename=$(echo $row | cut -d \| -f 1)
- operation=$(echo $row | cut -d \| -f 2)
- destination=$(echo $row | cut -d \| -f 3)
-
- case $operation in
- symlink)
- symlinkFile $filename $destination
- ;;
-
- *)
- echo "[WARNING] Unknown operation $operation. Skipping..."
- ;;
- esac
- done
+deploy_manifest() {
+ for row in $(cat $SCRIPT_DIR/$1); do
+ filename=$(echo $row | cut -d \| -f 1)
+ operation=$(echo $row | cut -d \| -f 2)
+ destination=$(echo $row | cut -d \| -f 3)
+
+ case $operation in
+ symlink)
+ symlink_file $filename $destination
+ ;;
+
+ *)
+ echo "[WARNING] Unknown operation $operation. Skipping..."
+ ;;
+ esac
+ done
}
echo "--- Configs ---"
-deployManifest MANIFEST
+deploy_manifest MANIFEST