-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish.bat
More file actions
60 lines (53 loc) · 1.13 KB
/
Copy pathpublish.bat
File metadata and controls
60 lines (53 loc) · 1.13 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
@echo off
setlocal
if "%~1"=="" (
echo Usage: publish.bat ^<library-name^>
echo.
echo Available libraries:
echo ngx-data-mapper
echo ngx-schema-editor
echo ngx-dyna-form
exit /b 1
)
set LIBRARY=%~1
if not exist "projects\%LIBRARY%" (
echo Error: Library '%LIBRARY%' not found in projects folder.
echo.
echo Available libraries:
echo ngx-data-mapper
echo ngx-schema-editor
echo ngx-dyna-form
exit /b 1
)
echo Building %LIBRARY%...
call ng build %LIBRARY%
if %errorlevel% neq 0 (
echo Build failed!
exit /b %errorlevel%
)
echo.
echo Checking npm login status...
call npm whoami >nul 2>&1
if %errorlevel% neq 0 (
echo Not logged in. Logging into npm...
call npm login
if %errorlevel% neq 0 (
echo npm login failed!
exit /b %errorlevel%
)
) else (
for /f %%i in ('npm whoami') do echo Logged in as: %%i
)
echo.
echo Publishing %LIBRARY%...
cd dist\%LIBRARY%
call npm publish --access public
if %errorlevel% neq 0 (
echo Publish failed!
cd ..\..
exit /b %errorlevel%
)
echo.
echo Successfully published %LIBRARY%!
cd ..\..
endlocal