mirror of
https://github.com/Cheviiot/Vintner.git
synced 2026-08-04 00:07:24 +00:00
Default download/install to ~/.msvc-go-wine when no dir is given
--dest (download) and the positional dir (install) were previously required, forcing every user to pick and remember a location. Both now default to a single hidden ~/.msvc-go-wine, matching the convention most CLI tools use for their own data dir - still overridable for anyone who wants a different location.
This commit is contained in:
@@ -8,11 +8,23 @@ import (
|
||||
)
|
||||
|
||||
func runInstall(args []string) int {
|
||||
if len(args) != 1 || args[0] == "-h" || args[0] == "--help" {
|
||||
fmt.Fprintln(os.Stderr, "usage: msvc-go-wine install <dest>")
|
||||
if len(args) > 1 || (len(args) == 1 && (args[0] == "-h" || args[0] == "--help")) {
|
||||
fmt.Fprintln(os.Stderr, "usage: msvc-go-wine install [dest] (default: ~/.msvc-go-wine)")
|
||||
return 1
|
||||
}
|
||||
dest := args[0]
|
||||
|
||||
var dest string
|
||||
if len(args) == 1 {
|
||||
dest = args[0]
|
||||
} else {
|
||||
def, err := defaultToolchainDir()
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "msvc-go-wine install:", err)
|
||||
return 1
|
||||
}
|
||||
dest = def
|
||||
fmt.Println("No directory given, using default:", dest)
|
||||
}
|
||||
|
||||
self, err := os.Executable()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user