parent
bf0863f4d0
commit
ec37a35d54
4
Makefile
4
Makefile
|
@ -75,5 +75,5 @@ build-releases:
|
||||||
-go-deb --release --no-gui --repo go.wit.com/apps/helloworld
|
-go-deb --release --no-gui --repo go.wit.com/apps/helloworld
|
||||||
-go-deb --release --no-gui --repo go.wit.com/apps/go-deb
|
-go-deb --release --no-gui --repo go.wit.com/apps/go-deb
|
||||||
|
|
||||||
debian:
|
debian: build
|
||||||
./go-deb --no-gui --repo go.wit.com/apps/go-deb
|
./go-deb --no-gui --keep-files --repo go.wit.com/apps/go-deb
|
||||||
|
|
|
@ -43,6 +43,7 @@ func (c *controlBox) buildPackage() (bool, error) {
|
||||||
debname := filename + "_" + version + "_" + arch + ".deb"
|
debname := filename + "_" + version + "_" + arch + ".deb"
|
||||||
fulldebname := filepath.Join(homeDir, "incoming", debname)
|
fulldebname := filepath.Join(homeDir, "incoming", debname)
|
||||||
if shell.Exists(fulldebname) {
|
if shell.Exists(fulldebname) {
|
||||||
|
log.Info("debian package already built: " + fulldebname)
|
||||||
return true, errors.New("debian package already built: " + fulldebname)
|
return true, errors.New("debian package already built: " + fulldebname)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +77,7 @@ func (c *controlBox) buildPackage() (bool, error) {
|
||||||
// add some standard golang flags
|
// add some standard golang flags
|
||||||
vldflag := "-X main.VERSION=" + version
|
vldflag := "-X main.VERSION=" + version
|
||||||
gldflag := "-X main.GUIVERSION=" + version // todo: git this from the filesystem
|
gldflag := "-X main.GUIVERSION=" + version // todo: git this from the filesystem
|
||||||
|
// timeflag := "-X main.BUILDTIME='${BUILDTIME}'"
|
||||||
cmd = append(cmd, "-ldflags", vldflag)
|
cmd = append(cmd, "-ldflags", vldflag)
|
||||||
cmd = append(cmd, "-ldflags", gldflag)
|
cmd = append(cmd, "-ldflags", gldflag)
|
||||||
|
|
||||||
|
@ -97,8 +99,9 @@ func (c *controlBox) buildPackage() (bool, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if shell.Exists("files") {
|
if shell.Exists("files") {
|
||||||
if shell.Run([]string{"rm", "-rf", "files"}) {
|
shell.Run([]string{"rm", "-rf", "files"})
|
||||||
log.Warn("rm failed")
|
if shell.Exists("files") {
|
||||||
|
log.Warn("rm failed for some reason")
|
||||||
return false, errors.New("rm files/")
|
return false, errors.New("rm files/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,8 +184,9 @@ func (c *controlBox) buildPackage() (bool, error) {
|
||||||
if argv.KeepFiles {
|
if argv.KeepFiles {
|
||||||
log.Info("keeping the build files/")
|
log.Info("keeping the build files/")
|
||||||
} else {
|
} else {
|
||||||
if shell.Run([]string{"rm", "-rf", "files"}) {
|
shell.Run([]string{"rm", "-rf", "files"})
|
||||||
log.Warn("rm failed")
|
if shell.Exists("files") {
|
||||||
|
log.Warn("rm -rf files/ failed. Run() returned false")
|
||||||
return false, errors.New("rm files/")
|
return false, errors.New("rm files/")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
main.go
4
main.go
|
@ -32,7 +32,7 @@ func main() {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
myGui = gui.New()
|
myGui = gui.New()
|
||||||
if ! argv.NoGui {
|
if !argv.NoGui {
|
||||||
myGui.InitEmbed(resources)
|
myGui.InitEmbed(resources)
|
||||||
myGui.Default()
|
myGui.Default()
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ func main() {
|
||||||
shell.TestTerminalColor()
|
shell.TestTerminalColor()
|
||||||
// basicWindow.Show() // broken gui package. convert to protobuf
|
// basicWindow.Show() // broken gui package. convert to protobuf
|
||||||
if ok, err := cBox.buildPackage(); ok {
|
if ok, err := cBox.buildPackage(); ok {
|
||||||
log.Info("build worked")
|
log.Info("build worked before. remove the .deb file to recreate it")
|
||||||
} else {
|
} else {
|
||||||
log.Warn("build failed:", err)
|
log.Warn("build failed:", err)
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
|
|
Loading…
Reference in New Issue