2017-10-06 10:20:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-12-15 11:29:57 +00:00
|
|
|
set -euo pipefail
|
2017-10-06 10:20:53 +00:00
|
|
|
|
2022-09-28 10:27:15 +00:00
|
|
|
prefix=""
|
|
|
|
|
|
|
|
while getopts ":p:" o; do
|
|
|
|
case "${o}" in
|
|
|
|
p)
|
|
|
|
prefix="${OPTARG}"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
usage
|
|
|
|
fatal "Invalid option -- ${OPTARG}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift $((OPTIND - 1))
|
|
|
|
|
|
|
|
branchname="${prefix}/$(slugify "$@" | cut -c 1-72)"
|
|
|
|
git checkout -b "${branchname##/}"
|