-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.15.0' into main
- Loading branch information
Showing
42 changed files
with
2,769 additions
and
959 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/dist | ||
/fyne-cross |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Website = "https://lucor.dev/paw" | ||
|
||
[Details] | ||
Icon = "logo/paw.png" | ||
Name = "paw" | ||
ID = "dev.lucor.paw" | ||
Version = "0.15.0" | ||
Build = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package main | ||
|
||
import ( | ||
"log" | ||
"os" | ||
|
||
"lucor.dev/paw/internal/cli" | ||
"lucor.dev/paw/internal/paw" | ||
) | ||
|
||
// Version allow to set the version at link time | ||
var Version string | ||
|
||
func main() { | ||
|
||
log.SetFlags(0) | ||
|
||
s, err := paw.NewOSStorage() | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
// Define the command to use | ||
commands := []cli.Cmd{ | ||
&cli.AddCmd{}, | ||
&cli.EditCmd{}, | ||
&cli.InitCmd{}, | ||
&cli.ListCmd{}, | ||
&cli.PwGenCmd{}, | ||
&cli.RemoveCmd{}, | ||
&cli.ShowCmd{}, | ||
&cli.VersionCmd{Version: Version}, | ||
} | ||
|
||
// display the usage if no command is specified | ||
if len(os.Args) == 1 { | ||
cli.Usage(commands) | ||
os.Exit(1) | ||
} | ||
|
||
// check for valid command | ||
var cmd cli.Cmd | ||
for _, v := range commands { | ||
if os.Args[1] == v.Name() { | ||
cmd = v | ||
break | ||
} | ||
} | ||
|
||
// If no valid command is specified display the usage | ||
if cmd == nil { | ||
cli.Usage(commands) | ||
os.Exit(1) | ||
} | ||
|
||
// Parse the arguments for the command | ||
// It will display the command usage if -help is specified | ||
// and will exit in case of error | ||
err = cmd.Parse(os.Args[2:]) | ||
if err != nil { | ||
log.Fatalf("[✗] %s", err) | ||
} | ||
|
||
// Finally run the command | ||
err = cmd.Run(s) | ||
if err != nil { | ||
log.Fatalf("[✗] %s", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,37 @@ | ||
package main | ||
|
||
import ( | ||
"runtime/debug" | ||
|
||
"fyne.io/fyne/v2" | ||
"fyne.io/fyne/v2/app" | ||
|
||
"lucor.dev/paw/internal/icon" | ||
"lucor.dev/paw/internal/ui" | ||
) | ||
|
||
// Version allow to set the version at link time | ||
var Version string | ||
|
||
func main() { | ||
a := app.NewWithID("dev.lucor.paw") | ||
a.SetIcon(icon.PawIcon) | ||
|
||
w := a.NewWindow("Paw") | ||
w.SetMaster() | ||
|
||
w.Resize(fyne.NewSize(800, 600)) | ||
w.SetContent(ui.Make(a, w)) | ||
w.SetContent(ui.Make(a, w, version())) | ||
w.ShowAndRun() | ||
} | ||
|
||
func version() string { | ||
if Version != "" { | ||
return Version | ||
} | ||
|
||
info, ok := debug.ReadBuildInfo() | ||
if ok { | ||
return info.Main.Version | ||
} | ||
return "(unknown)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.