Skip to content

Commit

Permalink
feat(command): add command g git, j jq, and t terraform resources (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuwas authored May 18, 2021
1 parent f27b923 commit e02f0fe
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BITEM=(
"h/helm"
"i/ip"
"i/istioctl"
"j/jq"
"k/kubectl"
"l/ls"
"p/ps"
Expand All @@ -27,6 +28,7 @@ CITEM=(
"helm"
"ifconfig"
"istioctl"
"jq"
"kubectl"
"ls"
"ps"
Expand Down
2 changes: 1 addition & 1 deletion src/a/all/vpn
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
set -xue ;
sshuttle -r "$1" "0/0" "${@:2}" ;
sshuttle --dns -r "$1" "0/0" "${@:2}" ;
3 changes: 3 additions & 0 deletions src/g/git/glnrhm
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
set -xue ;
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main "$@" ;
12 changes: 12 additions & 0 deletions src/g/git/gsmuo
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -xue ;
for DPATH in ./*/ ; do
cd ${DPATH} ;
echo "Directory : ${DPATH%*/}" ;
git remote update --prune ;
git checkout master ;
git reset --hard origin/master ;
"$@" ;
echo "" ;
cd .. ;
done ;
9 changes: 9 additions & 0 deletions src/j/jq/jfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh
set -xue ;
for FPATH in $( find $1 -type f ) ; do
TPATH="${FPATH}.tmp" ;
mv "${FPATH}" "${TPATH}" ;
jq "${@:2}" < "${TPATH}" > "${FPATH}" ;
rm "${TPATH}" ;
echo "" ;
done ;
5 changes: 5 additions & 0 deletions src/t/terraform/tffmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
set -xue ;
for DPATH in $( find "$@" -type d ) ; do
terraform fmt "${DPATH}" ;
done ;

0 comments on commit e02f0fe

Please sign in to comment.