Skip to content

Commit 7d1bda7

Browse files
committed
Use project-local build dir on cross-drive setups (GitHub Actions)
1 parent d744777 commit 7d1bda7

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

build.bat

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@ echo.
88

99
set "PROJECT_DIR=%~dp0"
1010
set "DIST_DIR=%PROJECT_DIR%dist\EfficientAssetRipper"
11-
set "BUILD_TEMP=%TEMP%\EAR_build"
11+
12+
:: BUILD_TEMP must live on the same drive as PROJECT_DIR so PyInstaller's
13+
:: makespec (which calls os.path.relpath) doesn't raise ValueError when the
14+
:: spec dir and the source main.py are on different drives. This bites on
15+
:: GitHub Actions runners where the workspace is on D:\ but %TEMP% is on C:\.
16+
set "PROJECT_DRIVE=%PROJECT_DIR:~0,2%"
17+
set "TEMP_DRIVE=%TEMP:~0,2%"
18+
if /I "%PROJECT_DRIVE%"=="%TEMP_DRIVE%" (
19+
set "BUILD_TEMP=%TEMP%\EAR_build"
20+
) else (
21+
set "BUILD_TEMP=%PROJECT_DIR%build\EAR_build"
22+
)
1223

1324
:: Skip interactive `pause` calls when running unattended (CI, scripts).
1425
:: Set the CI env var (GitHub Actions does this automatically) or

0 commit comments

Comments
 (0)