mirror of
https://github.com/jorgebucaran/fisher
synced 2024-06-28 23:01:50 +02:00
refactor: improve awk script readability in _fisher_fetch
This commit is contained in:
parent
23462edfd0
commit
37c9d70674
|
@ -314,7 +314,8 @@ function _fisher_fetch
|
||||||
continue
|
continue
|
||||||
end
|
end
|
||||||
|
|
||||||
command awk -v NAME=$i -v FS=/ 'BEGIN {
|
command awk -v NAME=$i -v FS=/ '
|
||||||
|
BEGIN {
|
||||||
if (split(NAME, tmp, /@+|:/) > 2) {
|
if (split(NAME, tmp, /@+|:/) > 2) {
|
||||||
if (tmp[4]) sub("@"tmp[4], "", NAME)
|
if (tmp[4]) sub("@"tmp[4], "", NAME)
|
||||||
print NAME "\t" tmp[2]"/"tmp[1]"/"tmp[3] "\t" (tmp[4] ? tmp[4] : "master")
|
print NAME "\t" tmp[2]"/"tmp[1]"/"tmp[3] "\t" (tmp[4] ? tmp[4] : "master")
|
||||||
|
@ -327,7 +328,8 @@ function _fisher_fetch
|
||||||
pkg ~ /^bitbucket/ ? "https://"pkg"/get/"tag".tar.gz" : pkg \
|
pkg ~ /^bitbucket/ ? "https://"pkg"/get/"tag".tar.gz" : pkg \
|
||||||
) "\t" pkg
|
) "\t" pkg
|
||||||
}
|
}
|
||||||
}' | read -l url pkg branch
|
}
|
||||||
|
' | read -l url pkg branch
|
||||||
|
|
||||||
if test ! -d "$fisher_config/$pkg"
|
if test ! -d "$fisher_config/$pkg"
|
||||||
fish -c "
|
fish -c "
|
||||||
|
|
Loading…
Reference in a new issue