Skip to content
Browse files

npm publish script.

  • Loading branch information...
1 parent 5f28c67 commit b6ab78da80116fe10cfe2e60eb0befdc9490ee0c Amit Apple committed
Showing with 61 additions and 0 deletions.
  1. +1 −0 .npmignore
  2. +60 −0 npmpublish.cmd
View
1 .npmignore
@@ -7,3 +7,4 @@ node_modules/
lib/*.js
build.cmd
*.map
+npmpublish.cmd
View
60 npmpublish.cmd
@@ -0,0 +1,60 @@
+@echo off
+
+setlocal
+
+set GIT_STATUS_RETURN_VALUE=
+
+echo Make sure no outstanding files to commit
+FOR /F "tokens=*" %%i IN ('git status -z') DO (
+ set GIT_STATUS_RETURN_VALUE=%%i
+)
+
+if NOT "%GIT_STATUS_RETURN_VALUE%" == "" (
+ git status
+ goto error
+)
+
+echo Building KuduSync
+call build.cmd
+
+echo Testing KuduSync
+call npm test
+IF %ERRORLEVEL% NEQ 0 goto error
+
+echo Fixing bin\kudusync.js line endings
+git commit bin/kudusync.js -m "Auto-generated file"
+
+del bin\kudusync.js
+IF %ERRORLEVEL% NEQ 0 goto error
+
+git checkout bin/kudusync.js
+IF %ERRORLEVEL% NEQ 0 goto error
+
+echo Testing KuduSync again
+call npm test
+IF %ERRORLEVEL% NEQ 0 goto error
+
+echo Incrementing KuduSync version
+call npm version patch
+IF %ERRORLEVEL% NEQ 0 goto error
+
+echo Trying to install KuduSync
+call npm install . -g
+IF %ERRORLEVEL% NEQ 0 goto error
+
+echp Publishing KuduSync
+call npm publish
+IF %ERRORLEVEL% NEQ 0 goto error
+
+echo Trying to install KuduSync from npm registry
+call npm install kudusync -g
+IF %ERRORLEVEL% NEQ 0 goto error
+
+goto end
+
+:error
+echo Publishing KuduSync failed
+exit /b 1
+
+:end
+echo Published successfully

0 comments on commit b6ab78d

Please sign in to comment.
Something went wrong with that request. Please try again.