Skip to content

Commit

Permalink
Auto pack template in build.cmd (dotnet#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinezh authored Jun 14, 2016
1 parent 39d70c4 commit c0d51d4
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ debugSettings.json
launchSettings.json
project.lock.json
*.sublime-workspace
*.nuget.targets
*.nuget.targets

###############
# template #
###############
src/docfx/Template/*.zip
37 changes: 37 additions & 0 deletions UpdateTemplate.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@ECHO OFF
PUSHD %~dp0

SETLOCAL
SETLOCAL ENABLEDELAYEDEXPANSION

:: Check if node exists globally
WHERE node >NUL
IF NOT '%ERRORLEVEL%'=='0' (
ECHO ERROR: UpdateTemplate.cmd requires node installed globally.
GOTO :Exit
)

SET TemplateHome=%~dp0src\docfx.website.themes\
SET DefaultTemplate=%TemplateHome%default

CALL npm install -g gulp

:: Check if gulp install successfully
WHERE gulp >NUL
IF NOT '%ERRORLEVEL%'=='0' (
ECHO ERROR: UpdateTemplate.cmd requires gulp installed globally.
GOTO :Exit
)

CD %DefaultTemplate%
CALL npm install
CALL gulp

CD %TemplateHome%
CALL npm install
CALL gulp

:Exit
POPD

EXIT /B %ERRORLEVEL%'
9 changes: 9 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ IF NOT '%ERRORLEVEL%'=='0' (
GOTO :Exit
)

:: Update template before build
ECHO Updating template
CALL UpdateTemplate.cmd

IF NOT '!ERRORLEVEL!'=='0' (
ECHO ERROR: Error occurs when updating template
GOTO :Exit
)

:: Restore packages for .csproj projects

CALL :RestorePackage
Expand Down
Binary file removed src/docfx/Template/default(zh-cn).zip
Binary file not shown.
Binary file removed src/docfx/Template/default.zip
Binary file not shown.
Binary file removed src/docfx/Template/docs.html.zip
Binary file not shown.
Binary file removed src/docfx/Template/iframe.html.zip
Binary file not shown.
Binary file removed src/docfx/Template/msdn.html.zip
Binary file not shown.
Binary file removed src/docfx/Template/op.html.zip
Binary file not shown.
Binary file removed src/docfx/Template/statictoc.zip
Binary file not shown.
Binary file removed src/docfx/Template/vs.html.zip
Binary file not shown.

0 comments on commit c0d51d4

Please sign in to comment.