Skip to content

Commit

Permalink
Update version
Browse files Browse the repository at this point in the history
Signed-off-by: QiuFeng54321 <[email protected]>
  • Loading branch information
WilliamQiufeng committed Oct 4, 2022
1 parent bb5925e commit 6bde00a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*.user
*.userosscache
*.sln.docstates
Build/

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
4 changes: 2 additions & 2 deletions PseudoCode.Core/PseudoCode.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>disable</Nullable>
<AssemblyVersion>1.3.4</AssemblyVersion>
<FileVersion>1.3.4</FileVersion>
<AssemblyVersion>1.3.5</AssemblyVersion>
<FileVersion>1.3.5</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions PseudoCode.Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ public class Program
}
};

public static Version CurrentVersion = typeof(PseudoProgram).Assembly.GetName().Version;
public static readonly Version CurrentVersion = typeof(PseudoProgram).Assembly.GetName().Version;

public static async Task RunProcessAsync(Process p)
private static async Task RunProcessAsync(Process p)
{
p.Start();
await p.WaitForExitAsync();
}

public static async Task<bool> DownloadAssetAsync(IEnumerable<ReleaseObject> objs, string s)
private static async Task<bool> DownloadAssetAsync(IEnumerable<ReleaseObject> objs, string s)
{
var obj = objs.FirstOrDefault(o => o.Assets.Any(a => a.Name == s));
if (obj == null)
Expand Down Expand Up @@ -70,10 +70,11 @@ await HttpClient.GetStringAsync(
"https://gitee.com/api/v5/repos/williamcraft/pseudocode-releases/releases?page=1&per_page=20&direction=desc");
// Console.WriteLine(resultStr);
var resultObjs = JsonSerializer.Deserialize<ReleaseObject[]>(new JsonTextReader(new StringReader(resultStr)));
var selfExe = Assembly.GetExecutingAssembly().Location;
Console.WriteLine(selfExe);

if (OperatingSystem.IsWindows())
{
var selfExe = Assembly.GetExecutingAssembly().Location;
if (await DownloadAssetAsync(resultObjs, WinZipName))
{
File.Move(selfExe, $"{selfExe}.bak");
Expand Down

0 comments on commit 6bde00a

Please sign in to comment.