Skip to content

Commit 2fc27c9

Browse files
committed
Update build.yml
1 parent df2f3f0 commit 2fc27c9

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/build.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,24 @@ jobs:
3939
# Copy necessary files into the dist directory
4040
Copy-Item -Recurse -Path "temp/*" -Destination "dist" -Force
4141
42-
- name: List files in the dist directory after copying
43-
run: |
44-
Get-ChildItem dist
45-
46-
- name: Update HTML files to include './' in src/href attributes
42+
- name: Update paths in HTML and JS files
4743
run: |
44+
# Update paths in HTML files
4845
Get-ChildItem dist\*.html | ForEach-Object {
49-
(Get-Content $_.FullName) -replace 'src="(/assets/)', 'src="./assets/' -replace 'href="(/assets/)', 'href="./assets/' | Set-Content $_.FullName
46+
(Get-Content $_.FullName) `
47+
-replace 'src="(/assets/)', 'src="./assets/' `
48+
-replace 'href="(/assets/)', 'href="./assets/' | Set-Content $_.FullName
49+
}
50+
51+
# Update paths in JS files inside the assets folder
52+
Get-ChildItem dist\assets\*.js | ForEach-Object {
53+
(Get-Content $_.FullName) `
54+
-replace '("/assets/)', '("./assets/' | Set-Content $_.FullName
5055
}
5156
52-
- name: List updated HTML files
57+
- name: List files in the dist directory after copying
5358
run: |
54-
Get-ChildItem dist\*.html
59+
Get-ChildItem dist
5560
5661
- name: Clear Electron Builder Cache
5762
run: |

0 commit comments

Comments
 (0)