From 2fc27c9cfa5ba276a6d842328dd0f3fda65be670 Mon Sep 17 00:00:00 2001 From: Kabir <44284877+kabir0x23@users.noreply.github.com> Date: Fri, 1 Nov 2024 13:01:15 +0530 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2330ca5..8ba6888 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,19 +39,24 @@ jobs: # Copy necessary files into the dist directory Copy-Item -Recurse -Path "temp/*" -Destination "dist" -Force - - name: List files in the dist directory after copying - run: | - Get-ChildItem dist - - - name: Update HTML files to include './' in src/href attributes + - name: Update paths in HTML and JS files run: | + # Update paths in HTML files Get-ChildItem dist\*.html | ForEach-Object { - (Get-Content $_.FullName) -replace 'src="(/assets/)', 'src="./assets/' -replace 'href="(/assets/)', 'href="./assets/' | Set-Content $_.FullName + (Get-Content $_.FullName) ` + -replace 'src="(/assets/)', 'src="./assets/' ` + -replace 'href="(/assets/)', 'href="./assets/' | Set-Content $_.FullName + } + + # Update paths in JS files inside the assets folder + Get-ChildItem dist\assets\*.js | ForEach-Object { + (Get-Content $_.FullName) ` + -replace '("/assets/)', '("./assets/' | Set-Content $_.FullName } - - name: List updated HTML files + - name: List files in the dist directory after copying run: | - Get-ChildItem dist\*.html + Get-ChildItem dist - name: Clear Electron Builder Cache run: |