summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2008-08-02 17:51:57 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2008-08-02 17:51:57 +0200
commit1048d5520ff30a561c2304b9b5cb433a5d1dd2fd (patch)
tree89cbdc292ed974e95d73358677f0dbda6d925bd7
parentbda576f0734a00bd8d39cb63c27b43fa38344567 (diff)
bin/pkg: Allow value override from shell environment, too
-rwxr-xr-xbin/pkg16
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/pkg b/bin/pkg
index 7a86b1c..e9848c6 100755
--- a/bin/pkg
+++ b/bin/pkg
@@ -1,14 +1,6 @@
#!/usr/bin/env zsh
# pkg - /home package manager and zsh playground
-PDIR="$HOME/packages"
-PKG_ROOT="ssh://derf.homelinux.org/~/var/packages_root"
-CL_OPTIONS=(-q)
-info=$'\e[0;36m'
-error=$'\e[0;31m'
-reset=$'\e[0m'
-
-
##
## Internal functions for displaying stuff
##
@@ -48,6 +40,14 @@ if [[ -f $HOME/.pkg.conf ]] {
. $HOME/.pkg.conf
}
+# Default values
+[[ -n $PDIR ]] || PDIR="$HOME/packages"
+[[ -n $PKG_ROOT ]] || PKG_ROOT="ssh://derf.homelinux.org/~/var/packages_root"
+[[ -n $CL_OPTIONS ]] || CL_OPTIONS=(-q)
+info=$'\e[0;36m'
+error=$'\e[0;31m'
+reset=$'\e[0m'
+
export PDIR
export PKG_ROOT