diff --git a/apis/installer.go b/apis/installer.go index 03467f44..b94c599b 100644 --- a/apis/installer.go +++ b/apis/installer.go @@ -32,7 +32,7 @@ func DefaultInstallerFunc(app core.App, systemSuperuser *core.Record, baseURL st _ = osutils.LaunchURL(url) color.Magenta("\n(!) Launch the URL below in the browser if it hasn't been open already to create your first superuser account:") color.New(color.Bold).Add(color.FgCyan).Println(url) - color.New(color.FgHiBlack, color.Italic).Printf("(you can also create your first superuser by running: %s superuser upsert EMAIL PASS)\n\n", os.Args[0]) + color.New(color.FgHiBlack, color.Italic).Printf("(you can also create your first superuser by running: %s superuser upsert EMAIL PASS)\n\n", executablePath()) return nil } @@ -86,3 +86,12 @@ func findOrCreateInstallerSuperuser(app core.App) (*core.Record, error) { return record, nil } + +func executablePath() string { + // most likely ran with go run + if strings.HasPrefix(os.Args[0], os.TempDir()) { + return "go run ." + } + + return os.Args[0] +}