summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pkg14
1 files changed, 13 insertions, 1 deletions
diff --git a/bin/pkg b/bin/pkg
index 2126d99..0ef07e9 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -27,6 +27,16 @@ die () {
exit 100
}
+pkg_proto () {
+ if (echo "$PKG_ROOT" | grep "^ssh" &> /dev/null) {
+ echo 'ssh'
+ } elif (echo "$PKG_ROOT" | grep "^/" &> /dev/null) {
+ echo 'file'
+ } else {
+ false
+ }
+}
+
confirm_yes () {
echo -n "$* [Y/n] "
read -k 1
@@ -173,8 +183,10 @@ pkg_list_installed () {
}
pkg_list_available () {
- if (echo "$PKG_ROOT" | grep "^ssh" &> /dev/null) {
+ if ([ "$(pkg_proto)" = 'ssh' ]) {
ssh -q $(echo "$PKG_ROOT" | sed 's!^ssh://!!' | sed -r 's!^([^/]*)/.*$!\1!') ls -1 $(echo "$PKG_ROOT" | sed 's!^ssh://[^/]*/!!')
+ } elif ([ "$(pkg_proto)" = 'file' ]) {
+ ls -1 $PKG_ROOT
}
}