Skip to content

Commit 43fc50a

Browse files
Merge pull request #11 from atomsk-0/contributorsPatch
contributors parsing should work now?
2 parents 8ab5a74 + d075175 commit 43fc50a

5 files changed

Lines changed: 23 additions & 14 deletions

File tree

.github/workflows/dotnet-desktop.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,11 @@ jobs:
7878
- name: Restore the application
7979
run: dotnet restore
8080

81+
# We copy the contributors to the "env:Configuration" result, the origin path is now hardcoded so if ever the repo name changes this needs to be changed too
8182
- name: Publish
82-
run: dotnet publish --configuration $env:Configuration --output ./$env:Configuration -r win-x64 /p:Platform=x64
83+
run: |
84+
dotnet publish --configuration $env:Configuration --output ./$env:Configuration -r win-x64 /p:Platform=x64
85+
copy D:/a/WinDurango.UI/WinDurango.UI/Assets/contributors.txt ./$env:Configuration/Assets/contributors.txt
8386
env:
8487
Configuration: ${{ matrix.configuration }}
8588

BuildScripts/build.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
python -m venv BuildScripts\venv
2-
BuildScripts\venv\Scripts\activate
1+
python -m venv .\venv
2+
call .\venv\Scripts\activate
33
pip install requests
4-
py BuildScripts\contributors.py
4+
py .\contributors.py

BuildScripts/contributors.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import os
33

4-
f = open('Assets/contributors.txt', 'w+')
4+
f = open(os.path.join(os.path.dirname(__file__), "..", "Assets", "contributors.txt"), "w+")
55

66
try:
77
import requests
@@ -27,6 +27,8 @@
2727
print("Couldn't fetch contributor information.")
2828
exit(0)
2929

30+
31+
3032
f.close()
3133

3234

Pages/AboutPage.xaml.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,19 @@ public AboutPage()
1414
{
1515
this.InitializeComponent();
1616

17-
string[] lines = File.ReadAllLines("Assets/contributors.txt");
18-
foreach (var contributor in lines)
17+
if (File.Exists("Assets/contributors.txt"))
1918
{
20-
string[] info = contributor.Split(";");
21-
string name = info[0].Replace("WD_CONTRIB_SEMICOLON", ";");
22-
string avatar = info[1].Replace("WD_CONTRIB_SEMICOLON", ";");
23-
string link = info[2].Replace("WD_CONTRIB_SEMICOLON", ";");
24-
string contributionCount = info[3];
19+
string[] lines = File.ReadAllLines("Assets/contributors.txt");
20+
foreach (var contributor in lines)
21+
{
22+
string[] info = contributor.Split(";");
23+
string name = info[0].Replace("WD_CONTRIB_SEMICOLON", ";");
24+
string avatar = info[1].Replace("WD_CONTRIB_SEMICOLON", ";");
25+
string link = info[2].Replace("WD_CONTRIB_SEMICOLON", ";");
26+
string contributionCount = info[3];
2527

26-
contributorList.Children.Add(new ContributorInfo(name, avatar, link));
28+
contributorList.Children.Add(new ContributorInfo(name, avatar, link));
29+
}
2730
}
2831
}
2932
}

WinDurango.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@
229229
</ItemGroup>
230230

231231
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
232-
<Exec Command="BuildScripts\build.bat" />
232+
<Exec Command="build.bat" WorkingDirectory="$(ProjectDir)\BuildScripts" />
233233
</Target>
234+
234235
</Project>

0 commit comments

Comments
 (0)