-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpublish.bat
More file actions
42 lines (33 loc) · 1.24 KB
/
Copy pathpublish.bat
File metadata and controls
42 lines (33 loc) · 1.24 KB
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
@echo off
setlocal
:: 1. Use %~dp0 to reliably get the directory where the .bat file lives
set "ROOT_DIR=%~dp0"
echo Checking npm authentication...
call npm whoami >nul 2>&1
if %errorlevel% neq 0 (
echo You are not logged in. Prompting for npm login...
call npm login || exit /b
)
echo Bumping root version...
call npm version patch || exit /b
echo Bumping library version...
:: 2. Use pushd/popd for safe directory switching
pushd "%ROOT_DIR%projects\ng-simple-state" || exit /b
call npm version patch || exit /b
popd
echo Building library...
:: 3. Use 'call' for npm commands to prevent the script from exiting early
call npm run build ng-simple-state || exit /b
echo Building schematics...
:: ng-packagr does not bundle the schematics: without this the "schematics" entry
:: in package.json would point at a collection missing from the package
call npm run build:schematics || exit /b
echo Copying metadata files...
copy /y "%ROOT_DIR%README.md" "%ROOT_DIR%dist\ng-simple-state\README.md" > nul || exit /b
copy /y "%ROOT_DIR%LICENSE" "%ROOT_DIR%dist\ng-simple-state\LICENSE" > nul || exit /b
echo Publishing library...
pushd "%ROOT_DIR%dist\ng-simple-state" || exit /b
call npm publish --ignore-scripts || exit /b
popd
echo Publish complete!
pause