Skip to content

Commit

Permalink
fix: fix QAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
Pd233 committed Mar 5, 2024
1 parent a0f3333 commit e00c7cc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
12 changes: 9 additions & 3 deletions src/LipUI/Models/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,17 @@ private static void Initialize()

private static void AutoUpdate()
{
var autoupdateDir = Path.Combine(WorkingDirectory, ".autoupdate");
if (Directory.Exists(autoupdateDir) is false)
var autoupdateDir = new DirectoryInfo(Path.Combine(ProgramDirectory, ".autoupdate"));
if (autoupdateDir.Exists is false)
return;

Process.Start(Path.Combine(autoupdateDir, "AutoUpdate.exe"), "--type lip_postinstall");
if (autoupdateDir.EnumerateFiles().Count() is 0)
{
autoupdateDir.Delete();
return;
}

Process.Start(Path.Combine(autoupdateDir.FullName, "AutoUpdate.exe"), "--type lip_postinstall");
Environment.Exit(0);
}

Expand Down
2 changes: 1 addition & 1 deletion src/LipUI/Pages/Settings/SettingsAndAboutView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ await InternalServices.ShowInfoBarAsync(

var args = @$"--type lipui_autoupdate --lip-path ""{path}"" --working-dir ""{Main.ProgramDirectory}""";
await InternalServices.ShowInfoBarAsync(
InternalServices.ShowInfoBar(
interval: TimeSpan.FromSeconds(3),
message: $"Running {args}");

Expand Down
18 changes: 13 additions & 5 deletions tooth.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"format_version": 2,
"tooth": "github.com/lippkg/LipUI",
"version": "0.4.5",
"version": "0.4.6",
"info": {
"name": "LipUI",
"description": "A GUI client for lip",
Expand All @@ -14,8 +14,12 @@
{
"goos": "windows",
"goarch": "amd64",
"asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.5/LipUI-win-x64.zip",
"commands": {},
"asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.6/LipUI-win-x64.zip",
"commands": {
"post-install": [
"./LipUI.exe"
]
},
"files": {
"place": [
{
Expand All @@ -28,8 +32,12 @@
{
"goos": "windows",
"goarch": "arm64",
"asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.5/LipUI-win-arm64.zip",
"commands": {},
"asset_url": "https://github.com/lippkg/LipUI/releases/download/v0.4.6/LipUI-win-arm64.zip",
"commands": {
"post-install": [
"./LipUI.exe"
]
},
"files": {
"place": [
{
Expand Down

0 comments on commit e00c7cc

Please sign in to comment.