mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-22 23:20:06 -07:00
kiss-fork: Add option to pick repository
This commit is contained in:
parent
d4a82ec0f1
commit
c8b5990acf
@ -4,17 +4,24 @@
|
|||||||
# Ignore shellcheck as we want the warning's behavior.
|
# Ignore shellcheck as we want the warning's behavior.
|
||||||
# shellcheck disable=2015
|
# shellcheck disable=2015
|
||||||
[ "$1" ] && kiss s "${1:-null}" >/dev/null || {
|
[ "$1" ] && kiss s "${1:-null}" >/dev/null || {
|
||||||
printf 'usage: kiss-fork [pkg]\n'
|
printf 'usage: [kiss-fork [pkg]] [index]\n'
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
num=$2
|
||||||
|
|
||||||
# Disable this warning as globbing is disabled and word splitting
|
# Disable this warning as globbing is disabled and word splitting
|
||||||
# is intentional. This grabs the location of the package's files.
|
# is intentional. This grabs the location of the package's files.
|
||||||
# shellcheck disable=2046
|
# shellcheck disable=2046
|
||||||
(
|
(
|
||||||
set -- $(kiss s "$1")
|
set -- $(kiss s "$1")
|
||||||
|
|
||||||
cp -r "$1" .
|
shift "${num:-0}"
|
||||||
|
|
||||||
|
[ -d "$1" ] && {
|
||||||
|
printf 'found package in %s\n' "$1"
|
||||||
|
cp -r "$1" .
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
printf 'forked package to %s\n' "$PWD/$1"
|
printf 'forked package to %s\n' "$PWD/$1"
|
||||||
|
Loading…
Reference in New Issue
Block a user