Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 7c67832

Browse files
committed
Added cmd pack script for windows.
1 parent c001bfe commit 7c67832

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

publish/pack.cmd

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
@echo off
2+
SET SOURCE_DIR=.\..\src
3+
SET TO_SOURCE_DIR=.\src
4+
SET PACK_DIR=.\package
5+
SET ROOT_DIR=.\..
6+
SET PUBLISH=--publish
7+
call npm i
8+
9+
echo Clearing /src and /package...
10+
@RD /S /Q %TO_SOURCE_DIR%
11+
@RD /S /Q %PACK_DIR%
12+
13+
REM copy src
14+
echo 'Copying src...'
15+
xcopy /s %SOURCE_DIR% %TO_SOURCE_DIR%\
16+
17+
REM copy README & LICENSE to src
18+
echo 'Copying README and LICENSE to /src...'
19+
copy %ROOT_DIR%\LICENSE %TO_SOURCE_DIR%\LICENSE
20+
copy %ROOT_DIR%\README.md %TO_SOURCE_DIR%\README.md
21+
22+
REM compile package and copy files required by npm
23+
echo 'Building /src...'
24+
cd %TO_SOURCE_DIR%
25+
call node_modules/.bin/tsc
26+
cd ..
27+
28+
echo 'Creating package...'
29+
REM create package dir
30+
mkdir %PACK_DIR%
31+
32+
REM create the package
33+
cd %PACK_DIR%
34+
call npm pack ..\%TO_SOURCE_DIR%
35+
36+
REM delete source directory used to create the package
37+
cd ..
38+
@RD /S /Q %TO_SOURCE_DIR%

0 commit comments

Comments
 (0)