Skip to content

Commit a4116bd

Browse files
committed
fix(npm): support clean install and npx launcher paths
- lazy-load optional installer dependencies in dist/npm/index.js - use built-in https for latest-version lookup and release downloads - fall back to plain logging when cli-spinner is unavailable - keep finish-install working without local node_modules in clean checkouts - teach npm launcher scripts to resolve index.js from the npx temp package layout - preserve existing global npm and yarn fallback lookup behavior
1 parent 76465fb commit a4116bd

3 files changed

Lines changed: 20 additions & 14 deletions

File tree

dist/npm/bin/devspace

100644100755
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ if [ ! -f "$BINARY" ] || [ "$STAT" -lt 10000 ]; then
1111
INDEX_FILE="/index.js"
1212

1313
if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then
14-
BASEDIR="$(dirname $0)/../lib/node_modules/devspace"
14+
BASEDIR="$(dirname $0)/../devspace"
1515

1616
if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then
17-
BASEDIR="$(dirname $0)/node_modules/devspace"
17+
BASEDIR="$(dirname $0)/../lib/node_modules/devspace"
1818

1919
if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then
20-
BASEDIR=$(/usr/bin/env npm root -g)/devspace
20+
BASEDIR="$(dirname $0)/node_modules/devspace"
2121

2222
if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then
23+
BASEDIR=$(/usr/bin/env npm root -g)/devspace
24+
2325
if [ ! -f "$BASEDIR/$INDEX_FILE" ]; then
2426
BASEDIR=$(/usr/bin/env yarn global dir)/node_modules/devspace
2527

dist/npm/bin/devspace.cmd

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,28 @@ SET indexFile=\index.js
1313
echo "!basedir!\!indexFile!"
1414

1515
IF NOT EXIST "!basedir!\!indexFile!" (
16-
SET basedir=%~dp0\..\lib\node_modules\devspace
16+
SET basedir=%~dp0\..\devspace
1717

1818
IF NOT EXIST "!basedir!\!indexFile!" (
19-
SET basedir=%~dp0\node_modules\devspace
19+
SET basedir=%~dp0\..\lib\node_modules\devspace
2020

2121
IF NOT EXIST "!basedir!\!indexFile!" (
22-
FOR /F "tokens=* USEBACKQ" %%F IN (`npm root -g`) DO (
23-
SET basedir=%%F\devspace
24-
)
22+
SET basedir=%~dp0\node_modules\devspace
2523

2624
IF NOT EXIST "!basedir!\!indexFile!" (
27-
FOR /F "tokens=* USEBACKQ" %%F IN (`yarn global dir`) DO (
28-
SET basedir=%%F\node_modules\devspace
25+
FOR /F "tokens=* USEBACKQ" %%F IN (`npm root -g`) DO (
26+
SET basedir=%%F\devspace
2927
)
3028

3129
IF NOT EXIST "!basedir!\!indexFile!" (
32-
echo Unable to find global npm/yarn dir
33-
exit /b 1
30+
FOR /F "tokens=* USEBACKQ" %%F IN (`yarn global dir`) DO (
31+
SET basedir=%%F\node_modules\devspace
32+
)
33+
34+
IF NOT EXIST "!basedir!\!indexFile!" (
35+
echo Unable to find global npm/yarn dir
36+
exit /b 1
37+
)
3438
)
3539
)
3640
)

dist/npm/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devspace",
3-
"version": "6.1.1",
3+
"version": "undefined",
44
"description": "DevSpace CLI - the swiss-army knife for Kubernetes. DevSpace CLI accelerates developing, deploying and debugging applications with Docker and Kubernetes.",
55
"bin": {
66
"devspace": "bin/devspace"
@@ -24,4 +24,4 @@
2424
"node-fetch": "^2.6.7"
2525
},
2626
"license": "Apache-2.0"
27-
}
27+
}

0 commit comments

Comments
 (0)