home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
291e586
)
Use local and read-only vars where possible
author
Siraaj Khandkar
<siraaj@khandkar.net>
Fri, 30 Oct 2020 21:06:42 +0000
(17:06 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Fri, 30 Oct 2020 21:06:42 +0000
(17:06 -0400)
home/lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
29b00ee
..
4fc413f
100644
(file)
--- a/
home/lib/login_functions.sh
+++ b/
home/lib/login_functions.sh
@@
-267,9
+267,10
@@
gh_fetch_repos() {
}
gh_clone() {
}
gh_clone() {
- gh_user_type="$1"
- gh_user_name="$2"
- gh_dir="${DIR_GITHUB}/${gh_user_name}"
+ local -r gh_user_type="$1"
+ local -r gh_user_name="$2"
+
+ local -r gh_dir="${DIR_GITHUB}/${gh_user_name}"
mkdir -p "$gh_dir"
cd "$gh_dir" || kill -INT $$
gh_fetch_repos "$gh_user_type" "$gh_user_name" \
mkdir -p "$gh_dir"
cd "$gh_dir" || kill -INT $$
gh_fetch_repos "$gh_user_type" "$gh_user_name" \
@@
-317,7
+318,7
@@
EOF
work_log() {
mkdir -p "$DIR_WORK_LOG"
work_log() {
mkdir -p "$DIR_WORK_LOG"
- file_work_log_today="${DIR_WORK_LOG}/$(date +%F).md"
+
local -r
file_work_log_today="${DIR_WORK_LOG}/$(date +%F).md"
if [ ! -f "$file_work_log_today" ]
then
work_log_template > "$file_work_log_today"
if [ ! -f "$file_work_log_today" ]
then
work_log_template > "$file_work_log_today"
@@
-353,10
+354,12
@@
bt_devs() {
}
run() {
}
run() {
- stderr="$(mktemp)"
+ local -r stderr="$(mktemp)"
+
+ local code urgency
+
$@ 2> >(tee "$stderr")
code="$?"
$@ 2> >(tee "$stderr")
code="$?"
- urgency=''
case "$code" in
0) urgency='normal';;
*) urgency='critical'
case "$code" in
0) urgency='normal';;
*) urgency='critical'
This page took
0.031013 seconds
and
4
git commands to generate.