@devkong/cli 0.0.67-alpha.0 → 0.0.67-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,28 @@
1
- @echo off
2
-
3
- set EXTENSION_DIR=%1
4
- echo %EXTENSION_DIR%
5
-
6
- where python >nul 2>&1
7
- if %errorlevel% equ 0 (
8
- set PYTHON_CMD=python
9
- ) else (
10
- set PYTHON_CMD=python3
11
- )
12
-
13
- where pip >nul 2>&1
14
- if %errorlevel% equ 0 (
15
- set PIP_CMD=pip
16
- ) else (
17
- set PIP_CMD=pip3
18
- )
19
-
20
- cd %EXTENSION_DIR%
21
-
22
- %PYTHON_CMD% -m venv .venv
23
-
24
- call .venv\Scripts\activate.bat
25
-
26
- %PIP_CMD% freeze > requirements-lock.txt
27
- %PIP_CMD% install --default-timeout=120 -r requirements.txt -r requirements-dev.txt
28
- %PIP_CMD% freeze > requirements-lock.txt
1
+ @echo off
2
+
3
+ set EXTENSION_DIR=%1
4
+ echo %EXTENSION_DIR%
5
+
6
+ where python >nul 2>&1
7
+ if %errorlevel% equ 0 (
8
+ set PYTHON_CMD=python
9
+ ) else (
10
+ set PYTHON_CMD=python3
11
+ )
12
+
13
+ cd %EXTENSION_DIR%
14
+
15
+ REM Recreate the venv from scratch so a stale interpreter path (e.g. left over
16
+ REM after a Python upgrade or a moved/copied project) can't leave pip pointing
17
+ REM at a missing binary.
18
+ %PYTHON_CMD% -m venv --clear .venv
19
+ if errorlevel 1 exit /b 1
20
+
21
+ call .venv\Scripts\activate.bat
22
+
23
+ REM Invoke pip via `python -m pip` rather than the pip/pip3 wrapper so we don't
24
+ REM depend on the wrapper script's (possibly stale) shebang.
25
+ python -m pip freeze > requirements-lock.txt
26
+ python -m pip install --default-timeout=120 -r requirements.txt -r requirements-dev.txt
27
+ if errorlevel 1 exit /b 1
28
+ python -m pip freeze > requirements-lock.txt
@@ -1,4 +1,5 @@
1
1
  #!/bin/bash
2
+ set -e
2
3
 
3
4
  EXTENSION_DIR=$1
4
5
 
@@ -8,18 +9,17 @@ else
8
9
  PYTHON_CMD="python3"
9
10
  fi
10
11
 
11
- if [ -x "$(command -v python)" ]; then
12
- PIP_CMD="pip"
13
- else
14
- PIP_CMD="pip3"
15
- fi
16
-
17
12
  cd "$EXTENSION_DIR" || exit
18
13
 
19
- $PYTHON_CMD -m venv .venv
14
+ # Recreate the venv from scratch so a stale interpreter path (e.g. left over
15
+ # after a Python/nvm/pyenv upgrade) can't leave pip pointing at a missing
16
+ # binary, which fails with "cannot execute: required file not found".
17
+ $PYTHON_CMD -m venv --clear .venv
20
18
 
21
19
  source .venv/bin/activate
22
20
 
23
- $PIP_CMD freeze > requirements-lock.txt
24
- $PIP_CMD install --default-timeout=120 -r requirements-dev.txt -r requirements.txt
25
- $PIP_CMD freeze > requirements-lock.txt
21
+ # Invoke pip via `python -m pip` rather than the pip/pip3 wrapper so we don't
22
+ # depend on the wrapper script's (possibly stale) shebang.
23
+ python -m pip freeze > requirements-lock.txt
24
+ python -m pip install --default-timeout=120 -r requirements-dev.txt -r requirements.txt
25
+ python -m pip freeze > requirements-lock.txt