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:
909ece3
)
Add gh_clone_repo function
author
Siraaj Khandkar
<siraaj@khandkar.net>
Fri, 19 Apr 2019 19:09:19 +0000
(15:09 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Fri, 19 Apr 2019 19:09:19 +0000
(15:09 -0400)
to cd to archive directory and clone given repo
lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/lib/login_functions.sh
b/lib/login_functions.sh
index
29bc3e2
..
950eb6f
100644
(file)
--- a/
lib/login_functions.sh
+++ b/
lib/login_functions.sh
@@
-91,6
+91,15
@@
gh_clone_org() {
gh_clone 'orgs' "$1"
}
+gh_clone_repo() {
+ gh_username=$(echo "$1" | awk -F / '"$1 == "https" && $3 == github.com" {print $4}')
+ gh_dir="${HOME}/Archives/Software/src/repos/remote/github.com/${gh_username}"
+ mkdir -p "$gh_dir"
+ cd "$gh_dir" || exit 1
+ git clone "$1"
+ cd - || exit 1
+}
+
work_log_template() {
cat << EOF
$(date +%F)
This page took
0.023465 seconds
and
4
git commands to generate.