-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
33 lines (26 loc) · 932 Bytes
/
Copy pathjustfile
File metadata and controls
33 lines (26 loc) · 932 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
32
33
green := "\\033[32m"
reset := "\\033[0m\n"
call_recipe := just_executable() + " --justfile=" + justfile()
_default:
@just --list
[doc("Stow a specific program's config files")]
stow dir:
@stow {{ dir }}
[doc("Unstow a specific program's config files")]
unstow dir:
@stow -D {{ dir }}
[doc("List all directories available for stowing")]
list:
@find . -maxdepth 1 -type d -not -path "*/.*" -not -name "." \
| sed "s/^.\///" \
| sort
[confirm('This will overwrite existing config files and do a git reset. Are you sure? [y/N]')]
[doc("Stow all directories as listed by `list`")]
stow-all:
@{{ call_recipe }} list | xargs stow --adopt
@git reset --hard
@printf "{{green}}All config files have been stowed.{{reset}}"
[doc("Unstow all directories as listed by `list`")]
unstow-all:
@{{ call_recipe }} list | xargs stow -D
@printf "{{green}}All config files have been unstowed.{{reset}}"