-
Notifications
You must be signed in to change notification settings - Fork 410
Expand file tree
/
Copy pathdevspace.cmd
More file actions
45 lines (34 loc) · 1.23 KB
/
devspace.cmd
File metadata and controls
45 lines (34 loc) · 1.23 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
@echo off
setlocal enabledelayedexpansion
WHERE devspace.exe >nul 2>nul
IF %ERRORLEVEL% EQU 0 devspace.exe %* && exit /b %errorlevel%
echo Finishing installation of DevSpace CLI
SET bindir=%~dp0
SET basedir=%~dp0\..
SET indexFile=\index.js
echo "!basedir!\!indexFile!"
IF NOT EXIST "!basedir!\!indexFile!" (
SET basedir=%~dp0\..\devspace
IF NOT EXIST "!basedir!\!indexFile!" (
SET basedir=%~dp0\..\lib\node_modules\devspace
IF NOT EXIST "!basedir!\!indexFile!" (
SET basedir=%~dp0\node_modules\devspace
IF NOT EXIST "!basedir!\!indexFile!" (
FOR /F "tokens=* USEBACKQ" %%F IN (`npm root -g`) DO (
SET basedir=%%F\devspace
)
IF NOT EXIST "!basedir!\!indexFile!" (
FOR /F "tokens=* USEBACKQ" %%F IN (`yarn global dir`) DO (
SET basedir=%%F\node_modules\devspace
)
IF NOT EXIST "!basedir!\!indexFile!" (
echo Unable to find global npm/yarn dir
exit /b 1
)
)
)
)
)
)
echo Running: node "!basedir!\!indexFile!" finish-install "!bindir!\"
node "!basedir!\!indexFile!" finish-install "!bindir!\" && (!bindir!\devspace.exe %* 2> nul || !bindir!\..\..\.bin\devspace.exe %* 2> nul || devspace.exe %*)