代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
set -e
PROGNAME=$0
BUILD_IMAGE=false
COOKIECUTTER_TEMPLATE='.'
usage() {
cat << EOF >&2
Usage: $PROGNAME [OPTIONS]
Options:
-b, --build Build Docker image before running cookiecutter
-t, --template Specify custom cookiecutter template via a URI to a git repo
e.g. https://github.com/cookiecutter-flask/cookiecutter-flask.git
Defaults to template in current working directory
-h, --help Show this message and exit
EOF
exit 1
}
process_args() {
while test $# -gt 0
do
case "$1" in
-h) usage
;;
--help) usage
;;
-b) BUILD_IMAGE=true
;;
--build) BUILD_IMAGE=true
;;
-t) COOKIECUTTER_TEMPLATE="$2"
shift
;;
--template) COOKIECUTTER_TEMPLATE="$2"
shift
;;
--*) usage;
exit 1;
;;
*) usage;
exit 1;
;;
esac
shift
done
}
run_cookiecutter() {
if [[ "$(docker images -q cookiecutter-docker 2> /dev/null)" == "" ]] || $BUILD_IMAGE ; then
docker build . --tag=cookiecutter-docker
fi
docker run -i -t -v ${PWD}:/build -w /build cookiecutter-docker ${COOKIECUTTER_TEMPLATE}
}
process_args "$@"
run_cookiecutter
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。