Browse code
Integrate dependency system into zshrc
Showing 10 changed files
- zsh_plugins/01-java.zsh
- zsh_plugins/01-pfff.zsh
- zsh_plugins/99-interaction.zsh
- zsh_plugins/99-path-setup.zsh
- zsh_plugins/dependencies/00-utils.zsh
- zsh_plugins/dependencies/java.zsh
- zsh_plugins/dependencies/pfff.zsh
- zsh_plugins/dependencies/todo.zsh
- zsh_plugins/00-utils.zsh
- zshrc_work
... | ... |
@@ -1,10 +1,12 @@ |
1 |
-#:depends-on:00-utils |
|
1 |
+#:depends-on:utils |
|
2 |
+#:depends-on:nix |
|
3 |
+#:depends-on:java |
|
4 |
+#:depends-on:pfff |
|
2 | 5 |
### |
3 | 6 |
PATH="${PATH%%:<<<:*}:${PATH##*:>>>:}" |
4 | 7 |
|
5 | 8 |
prepend_exe_path "$HOME/cj-projects/software/bin" |
6 | 9 |
prepend_exe_path "$HOME/cj-projects/software/resin/3.1.8-pro/bin" |
7 |
-prepend_exe_path "$HOME/pfff/bin" |
|
8 | 10 |
prepend_exe_path "$HOME/Library/Python/2.7/bin" |
9 | 11 |
prepend_exe_path "$HOME/go/bin" |
10 | 12 |
prepend_exe_path "$HOME/.rvm/bin" |
... | ... |
@@ -20,7 +22,7 @@ prepend_exe_path /usr/X11/bin |
20 | 22 |
prepend_exe_path "$HOME/vim8/bin" |
21 | 23 |
prepend_exe_path "$HOME/.cabal/bin" |
22 | 24 |
prepend_exe_path "$HOME/.local/bin" |
23 |
-prepend_exe_path /Library/Java/Home/bin |
|
25 |
+prepend_exe_path "$JAVA_HOME"/bin |
|
24 | 26 |
prepend_exe_path "$HOME/.nix-profile/bin" |
25 | 27 |
prepend_exe_path "$HOME/bin" |
26 | 28 |
|
0 | 3 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,61 @@ |
1 |
+TODO_DIR="$HOME/.todos" |
|
2 |
+ |
|
3 |
+if [[ ! -d "$TODO_DIR" ]]; then |
|
4 |
+ mkdir -p "$TODO_DIR"/{shells,archive} |
|
5 |
+fi |
|
6 |
+ |
|
7 |
+ds() { |
|
8 |
+ local task |
|
9 |
+ if [[ $# > 0 ]]; then |
|
10 |
+ task="$@" |
|
11 |
+ else |
|
12 |
+ read -r task\?'What doing? ' |
|
13 |
+ fi |
|
14 |
+ printf '%s' "$task" > "$TODO_DIR/shells/$$.txt" |
|
15 |
+} |
|
16 |
+ |
|
17 |
+td() { |
|
18 |
+ local task |
|
19 |
+ if [[ $# > 0 ]]; then |
|
20 |
+ task="$@" |
|
21 |
+ else |
|
22 |
+ read -r task\?'What doing? ' |
|
23 |
+ fi |
|
24 |
+ printf '%s' "$task" > "$TODO_DIR/current" |
|
25 |
+} |
|
26 |
+ |
|
27 |
+pop-todo() { |
|
28 |
+ local shell_file day_file |
|
29 |
+ shell_file="$TODO_DIR/shells/$$.txt" |
|
30 |
+ day_file="$TODO_DIR/current" |
|
31 |
+ |
|
32 |
+ if [[ -f "$shell_file" ]]; then |
|
33 |
+ mv "$shell_file" "$TODO_DIR/archive/$$.$(date +"%Y-%m-%d--%H-%M-%S")" |
|
34 |
+ return |
|
35 |
+ fi |
|
36 |
+ |
|
37 |
+ if [[ -f "$day_file" ]]; then |
|
38 |
+ mv "$day_file" "$TODO_DIR/archive/current.$(date +"%Y-%m-%d--%H-%M-%S")" |
|
39 |
+ return |
|
40 |
+ fi |
|
41 |
+} |
|
42 |
+ |
|
43 |
+doing() { |
|
44 |
+ local shell_file day_file |
|
45 |
+ shell_file="$TODO_DIR/shells/$$.txt" |
|
46 |
+ day_file="$TODO_DIR/current" |
|
47 |
+ |
|
48 |
+ if [[ -f "$shell_file" || -f "$day_file" ]]; then |
|
49 |
+ printf '\033[0;33mTODO: \033[0m' |
|
50 |
+ fi |
|
51 |
+ |
|
52 |
+ if [[ -f "$shell_file" ]]; then |
|
53 |
+ cat "$shell_file" | tr '\n' ' ' |
|
54 |
+ elif [[ -f "$day_file" ]]; then |
|
55 |
+ cat "$day_file" | tr '\n' ' ' |
|
56 |
+ fi |
|
57 |
+ |
|
58 |
+ if [[ -f "$shell_file" || -f "$day_file" ]]; then |
|
59 |
+ echo |
|
60 |
+ fi |
|
61 |
+} |
... | ... |
@@ -306,7 +306,10 @@ get_depends() { |
306 | 306 |
} |
307 | 307 |
|
308 | 308 |
build_depends() { |
309 |
- for depend in ${(f)$(get_depends "$1")}; do |
|
309 |
+ local -a depends |
|
310 |
+ depends=${(@f)$(get_depends "$1")} |
|
311 |
+ for depend in $depends; do |
|
312 |
+ echo dependency found: $depend |
|
310 | 313 |
script_depends[$1]+="$depend:" |
311 | 314 |
done |
312 | 315 |
} |