File tree Expand file tree Collapse file tree 4 files changed +25
-13
lines changed Expand file tree Collapse file tree 4 files changed +25
-13
lines changed Original file line number Diff line number Diff line change 1
1
help : show this help
2
2
reload : reload shell in same terminal
3
3
c : clear
4
+
4
5
tools : list tools and versions
5
6
whoami : whoami for all tools
6
- setsec : set secret.setsec foo " bar baz"
7
+
8
+ setsec : set secret. e.g. setsec foo " bar baz"
7
9
getsec : get secret. e.g. getsec foo
8
- tz : targz full dir. tz < name> < path>
9
- utz : extract targz dir. utz < file>
10
+ lssec : list secrets.
11
+
12
+ tz : targz full dir. tz < pathToCompress> < outputfile>
13
+ tz ./tools ./tools.tar.gz
14
+ utz : extract targz dir. utz < fileToUncompress> < pathUncompressTo>
15
+ utz ./tools.tar.gz ./tools
10
16
all : show all commands
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ alias tools="dot_tool_versions"
9
9
alias whoami=" dot_tool_whoami"
10
10
alias setsec=" dot_set_secret"
11
11
alias getsec=" dot_get_secret"
12
+ alias lssec=" dot_list_secrets"
12
13
alias tz=" dot_targz"
13
14
alias utz=" dot_untargz"
14
15
Original file line number Diff line number Diff line change @@ -73,4 +73,12 @@ function dot_get_secret() {
73
73
dot_ensure_key
74
74
mkdir -p " ${DOT_PRIV_PATH} /secrets"
75
75
openssl rsautl -inkey " ${DOT_KEY_PATH} " -decrypt < " ${DOT_PRIV_PATH} /secrets/${1} .dat"
76
+ }
77
+
78
+ function dot_list_secrets() {
79
+ for entry in " ${DOT_PRIV_PATH} /secrets" /* .dat
80
+ do
81
+ file=${entry##*/ }
82
+ echo ${file% .* }
83
+ done
76
84
}
Original file line number Diff line number Diff line change 1
1
2
- # $1 name
3
- # $2 path
2
+ # $1 path to compress
3
+ # $2 output targz file
4
4
function dot_targz() {
5
- # set -e
6
- local tgt=" ~/Packages/$1 .tar.gz"
7
- mkdir -p ~ /Packages
8
- pushd " ${2} " > /dev/null
9
- tar -c -z -f " ${tgt} " --strip-components=1 .
10
- echo " Created ${tgt} "
11
- popd > /dev/null
5
+ tar -C $1 -czv -f $2 .
12
6
}
13
7
8
+ # $1 file to uncompress
9
+ # $2 path to uncompress to
10
+ # will create the target path if it does not exist
14
11
function dot_untargz() {
15
- tar xzf $1
12
+ mkdir -p $2 && tar -C $2 -xzv -f $1
16
13
}
You can’t perform that action at this time.
0 commit comments