summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-16 09:49:49 -0600
committerJeff Carr <[email protected]>2024-11-16 09:49:49 -0600
commit526605ff8733f14baa737246e2d817d42a556675 (patch)
tree517d7cd6ca647bd2080f6b73366e3774a2b2863f /main.go
parentd45037dee96be62126c277a8738b39a52b9ed4b9 (diff)
add an example to build a custom .deb
Diffstat (limited to 'main.go')
-rw-r--r--main.go30
1 files changed, 20 insertions, 10 deletions
diff --git a/main.go b/main.go
index 06a96f7..c812420 100644
--- a/main.go
+++ b/main.go
@@ -35,7 +35,7 @@ func main() {
os.Exit(0)
}
myGui = gui.New()
- if !argv.Auto {
+ if !argv.Auto {
myGui.InitEmbed(resources)
}
myGui.Default()
@@ -44,8 +44,14 @@ func main() {
// todo: add the go.work file logic here
homeDir, _ := os.UserHomeDir()
- filepath := filepath.Join(homeDir, "go/src", argv.Repo)
- os.Chdir(filepath)
+ var debpath string
+ if argv.Repo == "." {
+ os.Setenv("GO_DEB_CUSTOM", "true")
+ debpath, _ = os.Getwd()
+ } else {
+ debpath = filepath.Join(homeDir, "go/src", argv.Repo)
+ }
+ os.Chdir(debpath)
// scan the repo
cBox.addRepo(argv.Repo)
@@ -60,19 +66,23 @@ func main() {
// verify the values for the package
if cBox.status == nil {
- log.Info("argv.Repo =", argv.Repo)
- log.Info("repo not found. Try:")
- log.Info("")
- log.Info(" go-clone", argv.Repo)
- log.Info("")
- os.Exit(-1)
+ if argv.Repo == "." {
+ // this means try the local directory for a custom 'control' file
+ } else {
+ log.Info("argv.Repo =", argv.Repo)
+ log.Info("repo not found. Try:")
+ log.Info("")
+ log.Info(" go-clone", argv.Repo)
+ log.Info("")
+ os.Exit(-1)
+ }
}
// set the working directory to argv.Repo
log.Info("cd", cBox.status.Path())
os.Chdir(cBox.status.Path())
- if argv.Auto {
+ if argv.Auto {
shell.TestTerminalColor()
// basicWindow.Show() // broken gui package. convert to protobuf
if ok, err := cBox.buildPackage(); ok {