3 Commits

Author SHA1 Message Date
pk
34fa69d58e Bump version 2024-09-11 11:31:05 +02:00
pk
7d9d5e3a58 Change package name to make go install work. 2024-09-11 11:30:48 +02:00
pk
eb0141f3bc Require that .hoster.yml is located in the users home dir. 2024-09-11 11:18:01 +02:00
6 changed files with 23 additions and 12 deletions

View File

@ -3,11 +3,12 @@ package commands
import ( import (
"context" "context"
"fmt" "fmt"
"hoster/internals/conf"
"io/fs" "io/fs"
"path/filepath" "path/filepath"
"strings" "strings"
"gitea.codeblob.work/pk/hoster/internals/conf"
dc "github.com/compose-spec/compose-go/v2/cli" dc "github.com/compose-spec/compose-go/v2/cli"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )

View File

@ -2,14 +2,15 @@ package commands
import ( import (
"fmt" "fmt"
"hoster/internals/conf"
"hoster/internals/helpers"
"hoster/internals/templates"
"hoster/internals/types"
"os" "os"
"path/filepath" "path/filepath"
"slices" "slices"
"gitea.codeblob.work/pk/hoster/internals/conf"
"gitea.codeblob.work/pk/hoster/internals/helpers"
"gitea.codeblob.work/pk/hoster/internals/templates"
"gitea.codeblob.work/pk/hoster/internals/types"
"github.com/gookit/goutil/fsutil" "github.com/gookit/goutil/fsutil"
"github.com/gookit/goutil/sysutil/cmdr" "github.com/gookit/goutil/sysutil/cmdr"
"github.com/kataras/golog" "github.com/kataras/golog"

View File

@ -1,21 +1,28 @@
package main package main
import ( import (
"hoster/cmd/hoster_cli/commands"
"hoster/internals/conf"
"os" "os"
"path/filepath"
"gitea.codeblob.work/pk/hoster/cmd/hoster_cli/commands"
"gitea.codeblob.work/pk/hoster/internals/conf"
"github.com/kataras/golog" "github.com/kataras/golog"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
) )
func main() { func main() {
conf.LoadConfig(".hoster.yml") homeDir, err := os.UserHomeDir()
if err != nil {
golog.Fatalf("Error getting home directory: %v", err)
}
conf.LoadConfig(filepath.Join(homeDir, ".hoster.yml"))
app := &cli.App{ app := &cli.App{
Name: "hoster", Name: "hoster",
Usage: "Hoster", Usage: "Hoster",
Version: "1.0.1", Version: "1.0.3",
Commands: []*cli.Command{ Commands: []*cli.Command{
{ {
Name: "new", Name: "new",

2
go.mod
View File

@ -1,4 +1,4 @@
module hoster module gitea.codeblob.work/pk/hoster
go 1.23.0 go 1.23.0

View File

@ -2,13 +2,14 @@ package helpers
import ( import (
"bufio" "bufio"
"hoster/internals/types"
"io/fs" "io/fs"
"os" "os"
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
"gitea.codeblob.work/pk/hoster/internals/types"
"github.com/gookit/goutil/fsutil" "github.com/gookit/goutil/fsutil"
) )

View File

@ -3,11 +3,12 @@ package templates
import ( import (
_ "embed" _ "embed"
"fmt" "fmt"
"hoster/internals/conf"
"os" "os"
"path/filepath" "path/filepath"
"text/template" "text/template"
"gitea.codeblob.work/pk/hoster/internals/conf"
"github.com/gookit/goutil/fsutil" "github.com/gookit/goutil/fsutil"
) )