Skip to content

Instantly share code, notes, and snippets.

@conorlawton
conorlawton / tasks.json
Created February 1, 2024 16:04
tasks.json for ccmod
{
// Set ccpath in environment variables to path to CrossCode executable.
// Add 7z executable to path
"version": "2.0.0",
"tasks": [
{
"label": "Run",
"type": "shell",
"command": "Remove-Item -Path (Join-Path ${workspaceFolder} -ChildPath \"dist\\assets\") -Force -Recurse;Copy-Item -Path (Join-Path -Path ${workspaceFolder} -ChildPath \"src\\assets\") -Destination \"${workspaceFolder}\\dist\" -Recurse;Copy-Item -Path (Join-Path -Path ${workspaceFolder} -ChildPath \"ccmod.json\") -Destination \"${workspaceFolder}\\dist\";$iconPath = (Join-Path -Path ${workspaceFolder} -ChildPath \"icon.png\"); if (Test-Path $iconPath) { Copy-Item -Path $iconPath -Destination \"${workspaceFolder}\\dist\"};tsc --project \"${workspaceFolder}\\tsconfig.json\" --outDir \"${workspaceFolder}\\dist\\${workspaceFolderBasename}\";Set-Location dist; 7z a -tzip \"${workspaceFolderBasename}.ccmod\" \"${workspaceFolder}\\dist\\*\" -xr!'*.ccmod';Copy-Item -Path \"${workspaceFolder}\\dist\\${workspaceFolderBasename}.ccmod\" -