Initial setup for the "run mode" concept

This commit is contained in:
2013-10-03 23:19:28 +01:00
parent 576a012332
commit 1f2373bab3
5 changed files with 21 additions and 6 deletions

View File

@@ -40,6 +40,7 @@ source "../lib/trim.sh"
source "../lib/internals/compile-dotfile.sh" source "../lib/internals/compile-dotfile.sh"
source "../lib/internals/create-symlink.sh" source "../lib/internals/create-symlink.sh"
source "../lib/internals/execute-dotfile.sh"
source "../lib/internals/locate-dotfile.sh" source "../lib/internals/locate-dotfile.sh"
source "../lib/internals/locate-target.sh" source "../lib/internals/locate-target.sh"
source "../lib/internals/parse-dotfile-options.sh" source "../lib/internals/parse-dotfile-options.sh"

5
src/lib/dotify-clean.sh Normal file
View File

@@ -0,0 +1,5 @@
dotify-clean() {
DOTIFY_RUN_MODE="clean"
execute-dotfile
return $?
}

View File

@@ -1,10 +1,5 @@
dotify-install() { dotify-install() {
locate-dotfile DOTIFY_RUN_MODE="install"
if [ -n "$?" ]; then return 1; fi
locate-target
if [ -n "$?" ]; then return 1; fi
execute-dotfile execute-dotfile
return $? return $?
} }

View File

@@ -0,0 +1,5 @@
dotify-uninstall() {
DOTIFY_RUN_MODE="uninstall"
execute-dotfile
return $?
}

View File

@@ -0,0 +1,9 @@
execute-dotfile() {
local dotfile_source="$(dotify-compile)"
locate-target
if [ "$?" != "0" ]; then return 1; fi
echo "$dotfile_source"
return $?
}