Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
0xk4b1r committed Nov 1, 2024
1 parent df2f3f0 commit 2fc27c9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down

0 comments on commit 2fc27c9

Please sign in to comment.