mirror of
https://git.sr.ht/~eliasnaur/gio-cmd
synced 2026-07-01 07:35:37 +00:00
gogio: add support for setting app name via command line
This allows the app name to have spaces and other characters not allowed in Go modules. Signed-off-by: Ilia Demianenko <ilia.demianenko@gmail.com>
This commit is contained in:
committed by
Elias Naur
parent
5c14d1ba64
commit
cf291ca3bd
+5
-1
@@ -37,12 +37,16 @@ func newBuildInfo(pkgPath string) (*buildInfo, error) {
|
|||||||
if *iconPath != "" {
|
if *iconPath != "" {
|
||||||
appIcon = *iconPath
|
appIcon = *iconPath
|
||||||
}
|
}
|
||||||
|
appName := getPkgName(pkgMetadata)
|
||||||
|
if *name != "" {
|
||||||
|
appName = *name
|
||||||
|
}
|
||||||
bi := &buildInfo{
|
bi := &buildInfo{
|
||||||
appID: appID,
|
appID: appID,
|
||||||
archs: getArchs(),
|
archs: getArchs(),
|
||||||
ldflags: getLdFlags(appID),
|
ldflags: getLdFlags(appID),
|
||||||
minsdk: *minsdk,
|
minsdk: *minsdk,
|
||||||
name: getPkgName(pkgMetadata),
|
name: appName,
|
||||||
pkgDir: pkgMetadata.Dir,
|
pkgDir: pkgMetadata.Dir,
|
||||||
pkgPath: pkgPath,
|
pkgPath: pkgPath,
|
||||||
iconPath: appIcon,
|
iconPath: appIcon,
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ var (
|
|||||||
buildMode = flag.String("buildmode", "exe", "specify buildmode (archive, exe)")
|
buildMode = flag.String("buildmode", "exe", "specify buildmode (archive, exe)")
|
||||||
destPath = flag.String("o", "", "output file or directory.\nFor -target ios or tvos, use the .app suffix to target simulators.")
|
destPath = flag.String("o", "", "output file or directory.\nFor -target ios or tvos, use the .app suffix to target simulators.")
|
||||||
appID = flag.String("appid", "", "app identifier (for -buildmode=exe)")
|
appID = flag.String("appid", "", "app identifier (for -buildmode=exe)")
|
||||||
|
name = flag.String("name", "", "app name (for -buildmode=exe)")
|
||||||
version = flag.Int("version", 1, "app version (for -buildmode=exe)")
|
version = flag.Int("version", 1, "app version (for -buildmode=exe)")
|
||||||
printCommands = flag.Bool("x", false, "print the commands")
|
printCommands = flag.Bool("x", false, "print the commands")
|
||||||
keepWorkdir = flag.Bool("work", false, "print the name of the temporary work directory and do not delete it when exiting.")
|
keepWorkdir = flag.Bool("work", false, "print the name of the temporary work directory and do not delete it when exiting.")
|
||||||
|
|||||||
Reference in New Issue
Block a user