83 lines
2.1 KiB
Plaintext
83 lines
2.1 KiB
Plaintext
# 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
|
||
|
||
CA__DIRS=()
|
||
|
||
#####################################################################
|
||
|
||
__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
|
||
|
||
#####################################################################
|
||
|
||
# additional cloning targets; MUST END IN ':' or '/'
|
||
# e.g. 'git@my.githost.com:' or 'git@github.com:w0ryn/'
|
||
CA__KNOWN_TARGETS=(
|
||
'git@yage.io:directus/'
|
||
'git@yage.io:brown-bag/'
|
||
'git@yage.io:gizmos/'
|
||
'git@yage.io:python/'
|
||
'git@yage.io:rentdynamics/'
|
||
'git@yage.io:wrynegade/'
|
||
'git@github.com:wrynegade/'
|
||
'git@github.com:directus/'
|
||
'https://yage.io/'
|
||
'https://github.com/'
|
||
'https://bitbucket.org/'
|
||
'git@bitbucket.org:wrynegade/'
|
||
)
|
||
|
||
|
||
# run from the specified hot-key
|
||
CA__SHORTCUT=' |