forked from projectkudu/KuduScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnpmpublish.cmd
More file actions
47 lines (34 loc) · 841 Bytes
/
npmpublish.cmd
File metadata and controls
47 lines (34 loc) · 841 Bytes
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
@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 kuduscript
call build.cmd
echo Testing kuduscript
call npm test
IF %ERRORLEVEL% NEQ 0 goto error
echo Incrementing kuduscript version
call npm version patch
IF %ERRORLEVEL% NEQ 0 goto error
echo Trying to install kuduscript
call npm install . -g
IF %ERRORLEVEL% NEQ 0 goto error
echo Publishing kuduscript
call npm publish
IF %ERRORLEVEL% NEQ 0 goto error
echo Trying to install kuduscript from npm registry
call npm install kuduscript -g
IF %ERRORLEVEL% NEQ 0 goto error
goto end
:error
echo Publishing kuduscript failed
exit /b 1
:end
echo Published successfully