代码拉取完成,页面将自动刷新
同步操作将从 phachon/mm-wiki 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/sh
# start go mod
export GO111MODULE=on
# set goproxy
export GOPROXY=https://goproxy.cn
PROJECT_NAME="mm-wiki"
INSTALL_NAME="install"
BUILD_DIR="release"
ROOT_DIR=`pwd`
# windows .exe
if [ "${GOOS}" = "windows" ]; then
PROJECT_NAME=${PROJECT_NAME}".exe"
INSTALL_NAME=${INSTALL_NAME}".exe"
fi
rm -rf ${BUILD_DIR}
build_app() {
mkdir -p ${ROOT_DIR}/${BUILD_DIR}/conf
mkdir -p ${ROOT_DIR}/${BUILD_DIR}/logs
mkdir -p ${ROOT_DIR}/${BUILD_DIR}/static
mkdir -p ${ROOT_DIR}/${BUILD_DIR}/views
mkdir -p ${ROOT_DIR}/${BUILD_DIR}/docs
/bin/cp -r ${ROOT_DIR}/conf/default.conf ${ROOT_DIR}/${BUILD_DIR}/conf/
/bin/cp -r ${ROOT_DIR}/conf/template.conf ${ROOT_DIR}/${BUILD_DIR}/conf/
/bin/cp -r ${ROOT_DIR}/scripts/* ${ROOT_DIR}/${BUILD_DIR}/
/bin/cp -r ${ROOT_DIR}/docs/* ${ROOT_DIR}/${BUILD_DIR}/docs/
/bin/cp -r ${ROOT_DIR}/views/* ${ROOT_DIR}/${BUILD_DIR}/views/
/bin/cp -r ${ROOT_DIR}/static/* ${ROOT_DIR}/${BUILD_DIR}/static/
/bin/cp -r ${ROOT_DIR}/CHANGELOG.md ${ROOT_DIR}/${BUILD_DIR}
/bin/cp -r ${ROOT_DIR}/README.md ${ROOT_DIR}/${BUILD_DIR}
/bin/cp -r ${ROOT_DIR}/README_eng.md ${ROOT_DIR}/${BUILD_DIR}
/bin/cp -r ${ROOT_DIR}/LICENSE ${ROOT_DIR}/${BUILD_DIR}
chmod -R 755 ${ROOT_DIR}/${BUILD_DIR}/conf/
chmod -R 755 ${ROOT_DIR}/${BUILD_DIR}/logs/
chmod -R 755 ${ROOT_DIR}/${BUILD_DIR}/static/
chmod -R 755 ${ROOT_DIR}/${BUILD_DIR}/views/
chmod -R 755 ${ROOT_DIR}/${BUILD_DIR}/*.sh
go build -o ${PROJECT_NAME} ./
if [ -f "${ROOT_DIR}/${PROJECT_NAME}" ]; then
mv ${ROOT_DIR}/${PROJECT_NAME} ${ROOT_DIR}/${BUILD_DIR}/
fi
return
}
build_install() {
mkdir -p ${ROOT_DIR}/${BUILD_DIR}/install
cd ${ROOT_DIR}/install
go build -o ${INSTALL_NAME} ./
chmod -R 755 ${ROOT_DIR}/${BUILD_DIR}/install/
if [ -f "${ROOT_DIR}/install/${INSTALL_NAME}" ]; then
mv ${ROOT_DIR}/install/${INSTALL_NAME} ${ROOT_DIR}/${BUILD_DIR}/install
fi
cd ../
return
}
build() {
echo ">> MM-Wiki start build!"
build_app
build_install
return
}
build
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。