Skip to content

Commit

Permalink
fix(build): fix typescript shenanigans and implement clone .SH script…
Browse files Browse the repository at this point in the history
… for UNIX-systems
  • Loading branch information
Falcion committed Oct 4, 2024
1 parent 2ed530e commit 8bf5e0f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
36 changes: 30 additions & 6 deletions clone-tracking.bat
Original file line number Diff line number Diff line change
@@ -1,22 +1,46 @@
@echo off

SET "FILE_PATH=clone.bat"
SET "CLONEBAT=clone.bat"

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

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

SET "CLONESH=clone.sh"

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 (
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"release:major": "standard-version --release-as major",
"generate-version-json": "node scripts/js/generate-version-json.js",
"cli": ".\\gh.cli.sh",
"build": "tsc -noEmit -skipLibCheck --esModuleInterop source/main.ts && node esbuild.config.mjs production && clone.bat"
"build": "tsc -noEmit -skipLibCheck --esModuleInterop --downlevelIteration source/main.ts && node esbuild.config.mjs production"
},
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"downlevelIteration": true,
"target": "es6",
"lib": [
"es2022",
Expand All @@ -31,4 +32,4 @@
"include": [
"**/*.ts"
]
}
}

0 comments on commit 8bf5e0f

Please sign in to comment.