Skip to content

Commit

Permalink
build(esbuild-tracking): write special .BAT script to disable worktre…
Browse files Browse the repository at this point in the history
…e for esbuild
  • Loading branch information
Falcion committed Nov 5, 2024
1 parent 969afd4 commit 7301437
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions build-tracking.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
SET "CLONESH=esbuild.config.mjs"

FOR /F "tokens=*" %%i IN ('git ls-files -v %CLONESH%') DO SET "CURRENT_STATUS=%%i"

IF "%CURRENT_STATUS:~0,1%"=="S" (
ECHO Currently, the file %CLONESH% is skipped.
ECHO Turning file tracking back ON...
git update-index --no-skip-worktree "%CLONESH%"
IF ERRORLEVEL 0 (
ECHO File tracking turned on successfully.
) ELSE (
ECHO Error: Could not turn file tracking on.
)
) ELSE (
ECHO Currently, the file %CLONESH% is being tracked.
ECHO Turning file tracking OFF...
git update-index --skip-worktree "%CLONESH%"
IF ERRORLEVEL 0 (
ECHO File tracking turned off successfully.
) ELSE (
ECHO Error: Could not turn file tracking off.
)
)

EXIT /B 0

0 comments on commit 7301437

Please sign in to comment.