Merge pull request #11 from atomsk-0/contributorsPatch

contributors parsing should work now?
This commit is contained in:
Dexrn ZacAttack
2025-03-03 10:46:50 -08:00
committed by GitHub
5 changed files with 23 additions and 14 deletions

View File

@@ -78,8 +78,11 @@ jobs:
- name: Restore the application
run: dotnet restore
# 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
- name: Publish
run: dotnet publish --configuration $env:Configuration --output ./$env:Configuration -r win-x64 /p:Platform=x64
run: |
dotnet publish --configuration $env:Configuration --output ./$env:Configuration -r win-x64 /p:Platform=x64
copy D:/a/WinDurango.UI/WinDurango.UI/Assets/contributors.txt ./$env:Configuration/Assets/contributors.txt
env:
Configuration: ${{ matrix.configuration }}

View File

@@ -1,4 +1,4 @@
python -m venv BuildScripts\venv
BuildScripts\venv\Scripts\activate
python -m venv .\venv
call .\venv\Scripts\activate
pip install requests
py BuildScripts\contributors.py
py .\contributors.py

View File

@@ -1,7 +1,7 @@
import json
import os
f = open('Assets/contributors.txt', 'w+')
f = open(os.path.join(os.path.dirname(__file__), "..", "Assets", "contributors.txt"), "w+")
try:
import requests
@@ -27,6 +27,8 @@ except:
print("Couldn't fetch contributor information.")
exit(0)
f.close()

View File

@@ -14,16 +14,19 @@ namespace WinDurango.UI.Pages
{
this.InitializeComponent();
string[] lines = File.ReadAllLines("Assets/contributors.txt");
foreach (var contributor in lines)
if (File.Exists("Assets/contributors.txt"))
{
string[] info = contributor.Split(";");
string name = info[0].Replace("WD_CONTRIB_SEMICOLON", ";");
string avatar = info[1].Replace("WD_CONTRIB_SEMICOLON", ";");
string link = info[2].Replace("WD_CONTRIB_SEMICOLON", ";");
string contributionCount = info[3];
string[] lines = File.ReadAllLines("Assets/contributors.txt");
foreach (var contributor in lines)
{
string[] info = contributor.Split(";");
string name = info[0].Replace("WD_CONTRIB_SEMICOLON", ";");
string avatar = info[1].Replace("WD_CONTRIB_SEMICOLON", ";");
string link = info[2].Replace("WD_CONTRIB_SEMICOLON", ";");
string contributionCount = info[3];
contributorList.Children.Add(new ContributorInfo(name, avatar, link));
contributorList.Children.Add(new ContributorInfo(name, avatar, link));
}
}
}
}

View File

@@ -229,6 +229,7 @@
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="BuildScripts\build.bat" />
<Exec Command="build.bat" WorkingDirectory="$(ProjectDir)\BuildScripts" />
</Target>
</Project>