print go run in the superuser create installer suggestion if temp dir location is detected
This commit is contained in:
+10
-1
@@ -32,7 +32,7 @@ func DefaultInstallerFunc(app core.App, systemSuperuser *core.Record, baseURL st
|
|||||||
_ = osutils.LaunchURL(url)
|
_ = 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.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.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
|
return nil
|
||||||
}
|
}
|
||||||
@@ -86,3 +86,12 @@ func findOrCreateInstallerSuperuser(app core.App) (*core.Record, error) {
|
|||||||
|
|
||||||
return record, nil
|
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]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user