Starting from scratch

This commit is contained in:
David Vennik
2022-12-21 18:24:57 +00:00
parent 56ece99727
commit 2a50a2c6de
2 changed files with 26 additions and 12 deletions

View File

@@ -1,13 +1,16 @@
package main
import (
"os"
"github.com/Indra-Labs/indra"
"github.com/cybriq/proc/pkg/app"
"github.com/cybriq/proc/pkg/cmds"
log2 "github.com/cybriq/proc/pkg/log"
"github.com/cybriq/proc/pkg/opts/config"
"github.com/cybriq/proc/pkg/opts/meta"
"github.com/cybriq/proc/pkg/opts/toggle"
"github.com/davecgh/go-spew/spew"
"os"
)
const lorem = `
@@ -18,12 +21,21 @@ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.`
var (
log = log2.GetLogger(indra.PathBase)
check = log.E.Chk
)
func main() {
command := &cmds.Command{
Name: "ind",
Description: "The indra network daemon.",
Documentation: lorem,
Entrypoint: func(c *cmds.Command, args []string) error {
log.I.Ln("running node")
return nil
},
Configs: config.Opts{
"AutoPorts": toggle.New(meta.Data{
Label: "Automatic Ports",
@@ -44,22 +56,24 @@ func main() {
cmds.GetConfigBase(command.Configs, command.Name, false)
cmds.Init(command, os.Args)
var err error
if command, err = cmds.Init(command, os.Args); check(err) {
return
}
var application *app.App
var err error
spew.Dump(command)
log.I.S(command)
if application, err = app.New(command, os.Args); err != nil {
spew.Dump(err)
os.Exit(1)
}
spew.Dump(application)
log.I.S(application)
if err = application.Launch(); err != nil {
spew.Dump(err)
os.Exit(1)
}
// if err = application.Launch(); err != nil {
// spew.Dump(err)
// os.Exit(1)
// }
}

View File

@@ -11,11 +11,11 @@ var (
// URL is the git URL for the repository.
URL = "github.com/Indra-Labs/indra"
// GitRef is the gitref, as in refs/heads/branchname.
GitRef = "refs/heads/main"
GitRef = "refs/heads/ind-bootstrap"
// ParentGitCommit is the commit hash of the parent HEAD.
ParentGitCommit = "da429601cd9db8d8161ad9a6d1d086dde12a9d34"
ParentGitCommit = "3d10be2bcbeeb1475bca46f8a34b254907a7b697"
// BuildTime stores the time when the current binary was built.
BuildTime = "2022-12-21T15:02:40Z"
BuildTime = "2022-12-21T18:24:57Z"
// SemVer lists the (latest) git tag on the build.
SemVer = "v0.0.212"
// PathBase is the path base returned from runtime caller.