aboutsummaryrefslogtreecommitdiff
path: root/installer/npm_install.cmd
diff options
context:
space:
mode:
Diffstat (limited to 'installer/npm_install.cmd')
-rw-r--r--installer/npm_install.cmd44
1 files changed, 23 insertions, 21 deletions
diff --git a/installer/npm_install.cmd b/installer/npm_install.cmd
index d17c974..caea4a8 100644
--- a/installer/npm_install.cmd
+++ b/installer/npm_install.cmd
@@ -1,21 +1,23 @@
-@echo off
-
-if "x%1" equ "x" goto :EOF
-if "x%2" equ "x" goto :EOF
-
-set server_dir="..\servers\%1"
-rd /Q /S "%server_dir%" 2>NUL
-md "%server_dir%"
-cd "%server_dir%"
-
-call npm init -y
-
-echo {"name":""}>package.json
-
-call npm install "%2"
-
-echo @echo off ^
-
-call %%~dp0\node_modules\.bin\%1.cmd %%* ^
-
-> %1.cmd
+@echo off
+
+if "x%1" equ "x" goto :EOF
+if "x%2" equ "x" goto :EOF
+
+set server_dir=..\servers\%1
+if exist "%server_dir%" rd /Q /S "%server_dir%"
+md "%server_dir%"
+pushd .
+cd /d "%server_dir%"
+
+call npm init -y
+
+echo {"name":""}>package.json
+
+call npm install "%2"
+
+echo @echo off ^
+
+call %%~dp0\node_modules\.bin\%1.cmd %%* ^
+
+> %1.cmd
+popd