diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-03-12 10:09:30 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-03-12 10:09:30 +0100 |
commit | 69c7016abf62de9ac89d589cc53c7c0c24cf5650 (patch) | |
tree | 810a2bf0d4cd25f6b7a6ff3f695bfcaf3aa6b707 /include/newpackage | |
parent | b94c8cb0629207e268db4e9380b4f857eb287e46 (diff) |
Added helper to create a new package in the PKG_ROOT
Diffstat (limited to 'include/newpackage')
-rwxr-xr-x | include/newpackage | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/newpackage b/include/newpackage new file mode 100755 index 0000000..70e5fa6 --- /dev/null +++ b/include/newpackage @@ -0,0 +1,29 @@ +#!/usr/bin/env zsh +## Set up a new package in the package_root +setopt err_exit +typeset package=$1 +typeset -i bare=0 + +while [[ $1 == --* ]] { + case $1 in + --bare) bare=1 + esac + shift +} + +[[ -r ~/.pkg.conf ]] && source ~/.pkg.conf +[[ -d $PKG_ROOT ]] || exit 1 + +cd $PKG_ROOT +if [[ -d $package ]] { + echo "Package $package already exists" >&2 + exit 2 +} +mkdir $package +cd $package +if ((bare)) { + git --bare init +} else { + git init + git config receive.denyCurrentBranch ignore +} |