#!/bin/sh
-cd ~/chromiumos
usage() {
cat <<-EOF
- Usage: repo-cros <command> [command opts]
+ Usage: repo-cros [dir] <command> [command opts]
Commands:
int switch to internal tree
}
[[ $# -eq 0 ]] && usage
-vexec() { echo "$@"; exec "$@"; }
+vexec() {
+ cd ${DIR:-~/chromiumos}
+ printf '%s\n%s\n' "${PWD}" "$*"
+ exec "$@"
+}
+DIR=
while [[ $# -gt 0 ]] ; do
case $1 in
int) vexec repo init -u ssh://gerrit-int.chromium.org:29419/chromeos/manifest-internal.git --repo-url='http://git.chromium.org/external/repo.git' ;;
ext) vexec repo init -u http://git.chromium.org/chromiumos/manifest.git --repo-url http://git.chromium.org/external/repo.git ;;
-b) vexec repo init -b $2 ;;
- *) usage ;;
+ *)
+ if [[ -z ${DIR} ]] ; then
+ DIR=$1
+ else
+ usage
+ fi
+ ;;
esac
+ shift
done
exit 0