mirror of
https://github.com/zdharma-continuum/zinit-annex-submods.git
synced 2025-01-30 17:38:17 +01:00
26a884eeef
Signed-off-by: Vladislav Doster <mvdoster@gmail.com>
32 lines
991 B
Bash
32 lines
991 B
Bash
#!/usr/bin/env zsh
|
|
#
|
|
# Copyright (c) 2016-2021 Sebastian Gniazdowski and contributors
|
|
# Copyright (c) 2021-2022 zdharma-continuum and contributors
|
|
#
|
|
|
|
builtin emulate -L zsh
|
|
setopt extendedglob warncreateglobal typesetsilent
|
|
|
|
[[ -z "${ICE[submods]}" ]] && return 0
|
|
|
|
[[ "$1" = plugin ]] \
|
|
&& local type="$1" user="$2" plugin="$3" id_as="$4" dir="$5" \
|
|
|| local type="$1" url="$2" id_as="$3" dir="$4"
|
|
|
|
local -a mods parts
|
|
local mod
|
|
mods=(${(@s.;.)ICE[submods]})
|
|
|
|
for mod in "${mods[@]}"; do
|
|
parts=("${(@s:->:)mod}")
|
|
parts=(${${parts[@]##[[:blank:]]##}%%[[:blank:]]##})
|
|
|
|
if [[ $parts[1] != (ftp|ftps|http|https|scp)://* ]]; then
|
|
parts[1]="https://github.com/${parts[1]}"
|
|
fi
|
|
|
|
+zi-log "{m} {b}submods{rst}: Cloning submodule {file}$parts[1]{rst} into $parts[2]"
|
|
command git -C "$dir" clone --progress "$parts[1]" "$parts[2]" 2>&1 | ${ZINIT[BIN_DIR]}/share/git-process-output.zsh
|
|
done
|
|
|
|
# vim: set expandtab filetype=zsh shiftwidth=4 softtabstop=4 tabstop=4:
|