1 Star 0 Fork 0

梦浮生 / AirSim-1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build_docs.bat 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
Shital Shah 提交于 2018-11-09 04:36 . add images folder in docs build
@echo off
REM //---------- set up variable ----------
setlocal
set ROOT_DIR=%~dp0
pushd %~dp0
set BUILD_DIR=%ROOT_DIR%temp\docs_build
rem mdir /s /q %BUILD_DIR%
robocopy "docs" "%BUILD_DIR%\doc_root\docs" /MIR /njh /njs /ndl /np /nfl /r:0
robocopy "." "%BUILD_DIR%\doc_root" *.md /njh /njs /ndl /np /nfl /r:0
robocopy "%BUILD_DIR%\doc_root\docs" "%BUILD_DIR%" mkdocs.yml /MOV /njh /njs /ndl /np /nfl /r:0
REM Copy of all folders is no needed as we use absolute URLs now
REM for /d %%x in (
REM "%ROOT_DIR%*"
REM ) do (
REM cd /d "%BUILD_DIR%\doc_root"
REM IF "%%~nx"=="" (
REM REM Do nothing
REM ) ELSE (
REM IF NOT EXIST "%%~nx" mklink /D "%%~nx" "%ROOT_DIR%%%~nx"
REM )
REM )
cd /d %BUILD_DIR%
if "%1"=="no_serve" goto PromptYN
mkdocs serve
:PromptYN
REM REM if exist "%SystemRoot%\System32\choice.exe" goto UseChoice
REM setlocal EnableExtensions EnableDelayedExpansion
REM :UseSetPrompt
REM set "PromptMessage=Do you want to commit to GitHub Pages [Y/N]? "
REM set "UserChoice=N"
REM set /P "UserChoice=%PromptMessage%"
REM set "UserChoice=!UserChoice: =!"
REM if /I "!UserChoice!" == "N" endlocal & goto :AnswerNo
REM if /I not "!UserChoice!" == "Y" goto UseSetPrompt
REM endlocal
REM goto AnswerYes
REM REM :UseChoice
REM REM %SystemRoot%\System32\choice.exe /C YN /N /M "%PromptMessage%"
REM REM if errorlevel 2 goto :AnswerNo
REM REM goto AnswerYes
REM :AnswerYes
REM @echo Building and commiting to gh-pages branch...
mkdocs build
robocopy "%BUILD_DIR%\doc_root\docs\images" "%BUILD_DIR%\build\images" /MIR /njh /njs /ndl /np /nfl /r:0
robocopy "%BUILD_DIR%\doc_root\docs\misc" "%BUILD_DIR%\build\misc" /MIR /njh /njs /ndl /np /nfl /r:0
robocopy "%BUILD_DIR%\doc_root\docs\paper" "%BUILD_DIR%\build\paper" /MIR /njh /njs /ndl /np /nfl /r:0
@echo Next Steps:
@echo git checkout gh-pages
@echo Copy "%BUILD_DIR%\build" to root
@echo Push gh-pages
REM batch file will get deleted so must execute commands in one line
REM git checkout gh-pages && cd /d %BUILD_DIR% && robocopy "%BUILD_DIR%\build" "%ROOT_DIR%docs" /MIR /njh /njs /ndl /np /nfl /r:0
goto success
:AnswerNo
@echo No commits were done.
goto success
:success
@echo "Task completed."
goto end
:failed
@echo "Task has failed."
goto end
:end
popd
1
https://gitee.com/ld0219/AirSim-1.git
git@gitee.com:ld0219/AirSim-1.git
ld0219
AirSim-1
AirSim-1
master

搜索帮助