代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
if [ $# -ge 1 ]; then
if [ $# -eq 2 ]; then
out_dir="$2"
else
if [ -z ${AAA_DIR+x} ]; then
echo "No output directory specified"
exit 1
fi
out_dir="$AAA_DIR"
fi
if [[ ! -d "$out_dir" ]]; then
echo "$out_dir is not a directory"
exit 1
fi
npm run build . /tmp/algorithm-archivists.github.io
if [ $? -ne 0 ]; then
echo "Failed to build the book"
exit 1
fi
cd "$out_dir"
git reset --hard && \
git clean -dfx && \
git pull origin master
if [ $? -ne 0 ]; then
echo "Failed to prepare repository"
exit 1
fi
cp -r /tmp/algorithm-archivists.github.io/* .
rm -r /tmp/algorithm-archivists.github.io
git add .
git commit -m "$1"
git push origin master
else
echo "No commit message specified"
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。