Ai
1 Star 0 Fork 0

idsutong/gqlgen

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.sh 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
Adam 提交于 2020-03-13 08:06 +08:00 . update doc site to point to latest version
#!/bin/bash
#
# This was adapted from https://github.com/dgraph-io/dgraph/blob/master/wiki/scripts/build.sh
#
set -e
GREEN='\033[32;1m'
RESET='\033[0m'
HOST=https://gqlgen.com
VERSIONS_ARRAY=(
'v0.11.3'
'origin/master'
'v0.10.2'
'v0.9.3'
'v0.8.3'
)
joinVersions() {
versions=$(printf ",%s" "${VERSIONS_ARRAY[@]}" | sed 's/origin\/master/master/')
echo "${versions:1}"
}
function version { echo "$@" | gawk -F. '{ printf("%03d%03d%03d\n", $1,$2,$3); }'; }
rebuild() {
VERSION_STRING=$(joinVersions)
export CURRENT_VERSION=${1}
if [[ $CURRENT_VERSION == 'origin/master' ]] ; then
CURRENT_VERSION="master"
fi
export VERSIONS=${VERSION_STRING}
hugo --quiet --destination="public/$CURRENT_VERSION" --baseURL="$HOST/$CURRENT_VERSION/"
if [[ $1 == "${VERSIONS_ARRAY[0]}" ]]; then
hugo --quiet --destination=public/ --baseURL="$HOST/"
fi
}
currentBranch=$(git rev-parse --abbrev-ref HEAD)
if ! git remote | grep -q origin ; then
git remote add origin https://github.com/99designs/gqlgen
fi
git fetch origin --tags
for version in "${VERSIONS_ARRAY[@]}" ; do
echo -e "$(date) $GREEN Updating docs for $version.$RESET"
rm -rf content
git checkout $version -- content
rebuild "$version"
done
rm -rf content
git checkout "$currentBranch" -- content
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/idsutong/gqlgen.git
git@gitee.com:idsutong/gqlgen.git
idsutong
gqlgen
gqlgen
master

搜索帮助