-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.cmd
49 lines (40 loc) · 1.14 KB
/
Package.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
@ECHO OFF
SETLOCAL
IF "%~1"=="" (
SET /P Version=Version ^(x.y.z^):
) ELSE (
SET Version=%~1
)
:: Copy to version-specific and latest DIST folder:
MKDIR "%~dp0dist\sircl-%Version%"
COPY "%~dp0src\SampleWebApplication\wwwroot\lib\sircl-src-new\*.*" "%~dp0dist\sircl-%version%\"
DEL "%~dp0dist\sircl-latest\*.*" /q
COPY "%~dp0src\SampleWebApplication\wwwroot\lib\sircl-src-new\*.*" "%~dp0dist\sircl-latest\"
:: Create "package.json" file in version-specific folder, and copy to latest folder:
ECHO {^
"name": "sircl",^
"version": "%version%",^
"description": "Serverside Rendering Coding Library",^
"author": "Codetuner",^
"main": "sircl-bundled.min.js",^
"repository": {^
"type": "git",^
"url": "https://github.com/codetuner/Sircl2"^
},^
"license": "MIT"^
}>"%~dp0dist\sircl-%version%\package.json"
COPY "%~dp0dist\sircl-%version%\package.json" "%~dp0dist\sircl-latest\package.json"
:: Create a ZIP file of version-specific folder:
PUSHD "%~dp0dist\sircl-%version%"
7za a ..\sircl-%version%.zip *
POPD
:: Ready to publish on NPM ?
PAUSE
ECHO.
ECHO Publish on NPM ?
PAUSE
PUSHD "%~dp0dist\sircl-%Version%"
CALL NPM login
CALL NPM publish
POPD
PAUSE