home
/
code
/
khome.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use local and read-only vars where possible
[khome.git]
/
home
/
lib
/
login_functions.sh
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.025842 seconds
and
4
git commands to generate.