-
Notifications
You must be signed in to change notification settings - Fork 15
/
npmpublish.cmd
60 lines (43 loc) · 1.14 KB
/
npmpublish.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
echo 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