Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 23 additions & 19 deletions configure.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,31 @@ if NOT DEFINED QUARTO_VENDOR_BINARIES (

if "%QUARTO_VENDOR_BINARIES%" == "true" (

REM Windows-specific: Check if deno.exe is running before deleting package/dist
REM Extracted to package/scripts/windows/check-deno-in-use.cmd for maintainability
call package\scripts\windows\check-deno-in-use.cmd "!QUARTO_DIST_PATH!"
if "!ERRORLEVEL!"=="1" exit /B 1

echo Removing package/dist/ directory...
RMDIR /S /Q "!QUARTO_DIST_PATH!" 2>NUL

REM Fallback: Verify deletion succeeded (defense in depth)
if exist "!QUARTO_DIST_PATH!" (
echo.
echo ============================================================
echo Error: Could not delete package/dist/ directory
echo This may be due to permissions, antivirus, or another process holding files
echo ============================================================
echo.
echo Try closing applications and run configure.cmd again
exit /B 1
REM CI sets QUARTO_SKIP_DENO_CACHE_WIPE=1 so the restored deno_cache survives
REM (matches the gate used by package\scripts\vendoring\vendor.cmd).
IF NOT "!QUARTO_SKIP_DENO_CACHE_WIPE!"=="1" (
REM Windows-specific: Check if deno.exe is running before deleting package/dist
REM Extracted to package/scripts/windows/check-deno-in-use.cmd for maintainability
call package\scripts\windows\check-deno-in-use.cmd "!QUARTO_DIST_PATH!"
if "!ERRORLEVEL!"=="1" exit /B 1

echo Removing package/dist/ directory...
RMDIR /S /Q "!QUARTO_DIST_PATH!" 2>NUL

REM Fallback: Verify deletion succeeded (defense in depth)
if exist "!QUARTO_DIST_PATH!" (
echo.
echo ============================================================
echo Error: Could not delete package/dist/ directory
echo This may be due to permissions, antivirus, or another process holding files
echo ============================================================
echo.
echo Try closing applications and run configure.cmd again
exit /B 1
)
)

MKDIR !QUARTO_BIN_PATH!\tools
IF NOT EXIST "!QUARTO_BIN_PATH!\tools" MKDIR !QUARTO_BIN_PATH!\tools
PUSHD !QUARTO_BIN_PATH!\tools

ECHO Bootstrapping Deno...
Expand Down
6 changes: 5 additions & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ if [[ "${QUARTO_VENDOR_BINARIES}" = "true" ]]; then
# Ensure directory is there for Deno
echo "Bootstrapping Deno..."

rm -rf "$QUARTO_DIST_PATH"
# CI sets QUARTO_SKIP_DENO_CACHE_WIPE=1 so the restored deno_cache survives
# (matches the gate used by package/scripts/vendoring/vendor.sh).
if [ "${QUARTO_SKIP_DENO_CACHE_WIPE}" != "1" ]; then
rm -rf "$QUARTO_DIST_PATH"
fi

## Binary Directory
mkdir -p "$QUARTO_BIN_PATH/tools"
Expand Down
Loading