2022-01-03 19:46:34 +00:00
|
|
|
|
# cloned projects will be nested under the specified directories,
|
|
|
|
|
# allowing for meaningful project grouping. A friendly name is
|
|
|
|
|
# derived from the path
|
|
|
|
|
#
|
|
|
|
|
# e.g. "$HOME/Projects/GitHub" will be called "GitHub" in the CLI
|
|
|
|
|
#
|
|
|
|
|
# directories must be fully-qualified
|
2024-06-27 00:42:33 +00:00
|
|
|
|
|
|
|
|
|
CA__DIRS=()
|
|
|
|
|
|
2024-08-16 15:41:26 +00:00
|
|
|
|
#####################################################################
|
|
|
|
|
|
|
|
|
|
__BASE_DIR="$(readlink -f -- "${XDG_DATA_HOME:-${HOME}/.local/share}/project-source-code")"
|
|
|
|
|
|
|
|
|
|
[ "${__BASE_DIR}" ] && {
|
|
|
|
|
[ -d "${HOME}/Projects" ] && mv "${HOME}/Projects" "${__BASE_DIR}" # TODO : remove after everyone is moved to xdg home
|
|
|
|
|
[ -d "${__BASE_DIR}" ] || mkdir -p -- "${__BASE_DIR}"
|
|
|
|
|
|
|
|
|
|
for __PROJECT_GROUP in \
|
|
|
|
|
brown-bag \
|
|
|
|
|
gizmos \
|
|
|
|
|
open-source \
|
|
|
|
|
python \
|
|
|
|
|
yage \
|
|
|
|
|
zsh \
|
|
|
|
|
;
|
|
|
|
|
do
|
|
|
|
|
mkdir -p "${__BASE_DIR}/${__PROJECT_GROUP}"
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
CA__DIRS+=($(find "${__BASE_DIR}" -mindepth 1 -maxdepth 1 -type d | sed 's/\/$//'))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unset __BASE_DIR
|
|
|
|
|
|
|
|
|
|
#####################################################################
|
2022-01-03 19:46:34 +00:00
|
|
|
|
|
|
|
|
|
# additional cloning targets; MUST END IN ':' or '/'
|
|
|
|
|
# e.g. 'git@my.githost.com:' or 'git@github.com:w0ryn/'
|
|
|
|
|
CA__KNOWN_TARGETS=(
|
2022-05-24 15:38:21 +00:00
|
|
|
|
'git@yage.io:directus/'
|
2022-04-20 19:04:08 +00:00
|
|
|
|
'git@yage.io:brown-bag/'
|
2022-01-20 21:46:13 +00:00
|
|
|
|
'git@yage.io:gizmos/'
|
|
|
|
|
'git@yage.io:python/'
|
2022-04-20 18:52:01 +00:00
|
|
|
|
'git@yage.io:rentdynamics/'
|
2022-04-20 19:04:08 +00:00
|
|
|
|
'git@yage.io:wrynegade/'
|
2022-01-10 13:36:34 +00:00
|
|
|
|
'git@github.com:wrynegade/'
|
2022-04-20 19:04:08 +00:00
|
|
|
|
'git@github.com:directus/'
|
2022-01-20 21:46:13 +00:00
|
|
|
|
'https://yage.io/'
|
2022-01-10 13:36:34 +00:00
|
|
|
|
'https://github.com/'
|
|
|
|
|
'https://bitbucket.org/'
|
2022-04-20 19:04:08 +00:00
|
|
|
|
'git@bitbucket.org:wrynegade/'
|
2022-01-03 19:46:34 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# run from the specified hot-key
|
|
|
|
|
CA__SHORTCUT=' |