-
Notifications
You must be signed in to change notification settings - Fork 2
/
package_installer.bat
47 lines (40 loc) · 1.18 KB
/
package_installer.bat
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
rem Specify the package names
set "package_names=blockly @blockly/shadow-block-converter"
rem Check if Node.js is installed
where node >nul 2>nul
if %errorlevel% neq 0 (
echo Node.js is not installed. Please install Node.js before running this script.
pause
exit /b 1
)
rem Check if npm is installed
where npm >nul 2>nul
if %errorlevel% neq 0 (
echo npm is not installed. Please install npm before running this script.
pause
exit /b 1
)
rem Loop over the array and install each package
for %%i in (%package_names%) do (
echo Installing %%i...
npm install %%i
rem Check if the installation was successful
if %errorlevel% equ 0 (
echo Package %%i has been successfully installed.
) else (
echo Failed to install package %%i.
)
)
rem Create mising files (secret.js)
echo Creating missing files...
if not exist src\secret.js (
echo The file src\secret.js does not exist. Creating it...
echo {"api_user_key": "YOUR_PASTEBIN_API_USER_KEY","api_dev_key" : "YOUR_PASTEBIN_API_DEV_KEY"} > src\secret.js
echo File src\secret.js has been created.
) else (
echo File src\secret.js already exists.
)
pause
endlocal