mirror of
https://github.com/jimeh/dotify.git
synced 2026-02-19 01:56:39 +00:00
Initial setup for the "run mode" concept
This commit is contained in:
@@ -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
5
src/lib/dotify-clean.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
dotify-clean() {
|
||||||
|
DOTIFY_RUN_MODE="clean"
|
||||||
|
execute-dotfile
|
||||||
|
return $?
|
||||||
|
}
|
||||||
@@ -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 $?
|
||||||
}
|
}
|
||||||
|
|||||||
5
src/lib/dotify-uninstall.sh
Normal file
5
src/lib/dotify-uninstall.sh
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
dotify-uninstall() {
|
||||||
|
DOTIFY_RUN_MODE="uninstall"
|
||||||
|
execute-dotfile
|
||||||
|
return $?
|
||||||
|
}
|
||||||
9
src/lib/internals/execute-dotfile.sh
Normal file
9
src/lib/internals/execute-dotfile.sh
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
execute-dotfile() {
|
||||||
|
local dotfile_source="$(dotify-compile)"
|
||||||
|
|
||||||
|
locate-target
|
||||||
|
if [ "$?" != "0" ]; then return 1; fi
|
||||||
|
|
||||||
|
echo "$dotfile_source"
|
||||||
|
return $?
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user