File tree Expand file tree Collapse file tree 14 files changed +201
-79
lines changed Expand file tree Collapse file tree 14 files changed +201
-79
lines changed Original file line number Diff line number Diff line change 1
- //registry.npmjs.org/:_authToken =
1
+ //registry.npmjs.org/:_authToken = ${ SEC_NPM_AUTH_TOKEN }
Original file line number Diff line number Diff line change
1
+ # .zshrc is a symlink to .zshrc in this repo wherever it is cloned on disk
1
2
export DOT_FILES_PATH=$( dirname $( readlink ~ /.zshrc) )
2
- export DOT_PRIV_PATH=" ${DOT_FILES_PATH} /../dotprivate"
3
3
4
+ source " ${DOT_FILES_PATH} /dot/load.sh"
4
5
5
- # get rid of the dots
6
- # https://stackoverflow.com/a/27756399/775184
7
- DOT_PRIV_PATH=$( cd ${DOT_PRIV_PATH} && pwd)
6
+ # workspaces is either in ~/Projects or in codespaces it's in /codespaces
7
+ export DOT_WORKSPACE_PATH=" ${HOME} /Projects"
8
+ if [ -d " /workspaces" ]; then
9
+ # codespaces
10
+ DOT_WORKSPACE_PATH=" /workspaces"
11
+ fi
12
+
13
+ export DOT_PRIV_PATH=" ${DOT_WORKSPACE_PATH} /dotprivate"
8
14
9
15
clear
10
- source " ${DOT_FILES_PATH} /common/load.sh"
11
- echo
12
- echo -n -e " \033]0;Dev Environment\007"
13
- echo Dev Environment
14
- echo Welcome ${USER} !
15
- echo
16
+
17
+ " ${DOT_FILES_PATH} /dot/welcome.sh"
16
18
17
19
# https://scriptingosx.com/2019/07/moving-to-zsh-06-customizing-the-zsh-prompt/
18
20
PROMPT=' %(?.%F{green}√.%F{red}?%?)%f %B%F{250}%1~%f%b %(!.#.$) '
Original file line number Diff line number Diff line change 1
1
2
- <p align =" center " >
3
- <img src="res/tilda.png"/>
2
+
3
+ <p align =" center " style =" font-size :20vw " >
4
+ ~/.
4
5
</p >
5
6
6
7
## setup
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ [[ " ${DOT_COMMON:- " " } " == " loaded" ]] && return 0
4
+ DOT_COMMON=loaded
5
+
6
+ function fail()
7
+ {
8
+ rc=$?
9
+ echo
10
+ echo " ❌ $1 (last rc: ${rc} )" >&2
11
+ echo
12
+ exit 1
13
+ }
14
+
15
+ pushd () {
16
+ command pushd " $@ " > /dev/null
17
+ }
18
+
19
+ popd () {
20
+ command popd " $@ " > /dev/null
21
+ }
22
+
23
+ cprint () {
24
+ # https://stackoverflow.com/a/64824268/775184
25
+ intense=' 1'
26
+ under=' 4'
27
+
28
+ # Regular Colors
29
+ black=' 30' # Black
30
+ red=' 31' # Red
31
+ green=' 32' # Green
32
+ yellow=' 33' # Yellow
33
+ blue=' 34' # Blue
34
+ purple=' 35' # Purple
35
+ cyan=' 36' # Cyan
36
+ white=' 37' # White
37
+
38
+ # Background
39
+ onblack=' 40' # Black
40
+ onred=' 41' # Red
41
+ ongreen=' 42' # Green
42
+ onyellow=' 43' # Yellow
43
+ onblue=' 44' # Blue
44
+ onpurple=' 45' # Purple
45
+ oncyan=' 46' # Cyan
46
+ onwhite=' 47' # White
47
+
48
+ msg=$1
49
+ shift
50
+
51
+ codes=" \033["
52
+ for (( i= 1 ; i<= $# ; i++ ))
53
+ do
54
+ id=${! i}
55
+ # echo "${id} is ${!id}"
56
+ codes=" ${codes}${! id} "
57
+
58
+ if [ $i -ne $# ]; then
59
+ codes=" ${codes} ;"
60
+ fi
61
+ done
62
+ codes=" ${codes} m"
63
+
64
+ # echo "${codes}"
65
+
66
+ printf " ${codes}${msg} \033[0m"
67
+ }
68
+
69
+ dot_section () {
70
+ printf " \n "
71
+ cprint " ${1} " " white" " intense"
72
+ if [ " $2 " ]; then
73
+ printf " : $2 "
74
+ fi
75
+ echo
76
+ }
77
+
78
+ dot_message () {
79
+ cprint " ${1} " " white" " intense"
80
+ if [ " $2 " ]; then
81
+ printf " $2 "
82
+ fi
83
+ printf " \n"
84
+ }
85
+
86
+ # manSection() {
87
+ # printf "\n "
88
+ # cprint "$1" "white" "under" "intense"
89
+ # }
90
+
91
+ dot_man () {
92
+ cmd=" $( printf " %-15s" " ${1} " ) "
93
+ cprint " $cmd " " cyan" " intense"
94
+ cprint " $2 \n"
95
+
96
+ if [ " $3 " ]; then
97
+ eg=" $( printf " %-18s%s" " " " ( e.g. $3 )" ) "
98
+ cprint " $eg \n" " grey"
99
+ fi
100
+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ function dot_load() {
19
19
20
20
[ ! -d " ${DOT_FILES_PATH} " ] && >&2 echo " ${DOT_FILES_PATH} missing" && return 1
21
21
22
- source " ${DOT_FILES_PATH} /common/env.sh"
22
+ # source "${DOT_FILES_PATH}/common/env.sh"
23
23
24
24
# load public scripts
25
25
for filename in ${DOT_FILES_PATH} /rc/* .sh; do
@@ -40,4 +40,4 @@ function dot_load_tools() {
40
40
for filename in ${DOT_FILES_PATH} /tools/* .sh; do
41
41
source " ${filename} "
42
42
done
43
- }
43
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ SCRIPT_DIR=" $( cd " $( dirname " $0 " ) " && pwd ) "
4
+ . $SCRIPT_DIR /common.sh
5
+
6
+ dot_section " Commands"
7
+ echo
8
+ dot_man " help" " show this help"
9
+ dot_man " reload" " reload shell in same terminal"
10
+ dot_man " c" " clear"
11
+ dot_man " all" " show all commands"
12
+
13
+ echo
14
+ dot_man " tools" " list tools and versions"
15
+ dot_man " me" " who am I for all tools"
16
+
17
+ echo
18
+ dot_man " setsec" " set secret. e.g. setsec foo \" bar baz\" "
19
+ dot_man " getsec" " get secret. e.g. getsec foo"
20
+ dot_man " lssec" " list secrets."
21
+
22
+ echo
23
+ dot_man " tz" " targz full dir. tz <pathToCompress> <outputfile>" " tz ./tools ./tools.tar.gz"
24
+ dot_man " utz" " extract targz dir. utz <fileToUncompress> <pathUncompressTo>" " utz ./tools.tar.gz ./tools"
25
+
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ SCRIPT_DIR=" $( cd " $( dirname " $0 " ) " && pwd ) "
4
+ . $SCRIPT_DIR /common.sh
5
+
6
+ # echo
7
+ echo -n -e " \033]0;Dev Environment\007"
8
+ echo
9
+ dot_message " Dev Environment"
10
+ dot_message " Welcome" " ${USER} !"
11
+ dot_section " Workspaces" " ${DOT_WORKSPACE_PATH} "
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
2
- workspaces=" ~"
3
- if [ -d " ${HOME} /Projects" ]; then
4
- workspaces=" ~/Projects"
5
- elif [ -d " /workspaces" ]; then
6
- # codespaces
7
- workspaces=" /workspaces"
8
- fi
9
-
10
- echo " workspace: ${workspaces} "
11
-
12
2
alias help=" dot_help"
13
3
alias all=" echo;alias;echo"
14
- alias c=" clear "
4
+ alias c=" tput reset "
15
5
16
6
# Reload the shell (i.e. invoke as a login shell)
17
7
alias reload=" exec ${SHELL} -l"
@@ -34,7 +24,7 @@ alias -- -="cd -"
34
24
# Shortcuts
35
25
alias dl=" pushd ~/Downloads > /dev/null"
36
26
alias dt=" pushd ~/Desktop > /dev/null"
37
- alias w=" pushd ${workspaces } > /dev/null"
27
+ alias w=" pushd ${DOT_WORKSPACE_PATH } > /dev/null"
38
28
alias s=" pushd ~/Study > /dev/null"
39
29
alias pkg=" pushd ~/Packages > /dev/null"
40
30
Original file line number Diff line number Diff line change 1
1
function dot_help() {
2
2
echo
3
- local files_help_path=" ${DOT_FILES_PATH} /man"
3
+ ${DOT_FILES_PATH} /dot/man.sh
4
+ # local files_help_path="${DOT_FILES_PATH}/man"
4
5
local priv_help_path=" ${DOT_PRIV_PATH} /man"
5
6
6
- [ -f " ${files_help_path} " ] && cat " ${files_help_path} " && echo
7
+ # [ -f "${files_help_path}" ] && cat "${files_help_path}" && echo
7
8
[ -f " ${priv_help_path} " ] && cat " ${priv_help_path} " && echo
8
9
}
9
10
10
- function printToolInfo() {
11
- printf " %-15s%s\n" " $1 " " : $2 "
12
- # | tr ' ~' '- '
13
- }
14
-
15
- function dot_tool_versions() {
16
- echo
17
- for filename in ${DOT_FILES_PATH} /tools/* .sh; do
18
- file=" ${filename##*/ } "
19
- tool=" ${file% .sh} "
20
- func=" dot_${tool} _version"
21
- eval " $func "
22
- done
23
- echo
24
- }
25
-
26
- function dot_tool_whoami() {
27
- echo
28
- echo " Who am I? ..."
29
- for filename in ${DOT_FILES_PATH} /tools/* .sh; do
30
- file=" ${filename##*/ } "
31
- tool=" ${file% .sh} "
32
- func=" dot_${tool} _whoami"
33
- eval " $func "
34
- done
35
- echo
36
- }
37
-
38
11
export DOT_CFG_PATH=" ${HOME} /.dotfiles"
39
12
export DOT_KEY_PATH=" ${DOT_CFG_PATH} /secrets.key"
40
13
Original file line number Diff line number Diff line change
1
+
2
+ function printToolInfo() {
3
+ printf " %-15s%s\n" " $1 " " : $2 "
4
+ # | tr ' ~' '- '
5
+ }
6
+
7
+ function dot_tool_versions() {
8
+ echo
9
+ for filename in ${DOT_FILES_PATH} /tools/* .sh; do
10
+ file=" ${filename##*/ } "
11
+ tool=" ${file% .sh} "
12
+ func=" dot_${tool} _version"
13
+ eval " $func "
14
+ done
15
+ echo
16
+ }
17
+
18
+ function dot_tool_whoami() {
19
+ echo
20
+ echo " Who am I? ..."
21
+ for filename in ${DOT_FILES_PATH} /tools/* .sh; do
22
+ file=" ${filename##*/ } "
23
+ tool=" ${file% .sh} "
24
+ func=" dot_${tool} _whoami"
25
+ eval " $func "
26
+ done
27
+ echo
28
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # install brew if not installed
4
+ # we can install most other things using brew afterwards
5
+
6
+ if [ ! -x " $( command -v brew) " ]; then
7
+ echo " Installing brew ..."
8
+ /bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) "
9
+ echo
10
+ fi
Original file line number Diff line number Diff line change 1
1
2
- export NVM_DIR= " $HOME /.nvm "
3
- if [ -d ${NVM_DIR} ] ; then
4
- [ -s " $NVM_DIR /nvm.sh " ] && . " $NVM_DIR /nvm.sh "
5
- nvm use 14
2
+ NODE_VERSION=16
3
+ NODE_BREW_PATH=/usr/local/opt/node@16/bin
4
+ if [ -d " ${NODE_BREW_PATH} " ]; then
5
+ PATH= " $NODE_BREW_PATH : $PATH "
6
6
fi
7
7
8
8
nodePath=` which node`
You can’t perform that action at this time.
0 commit comments