Skip to content

Commit

Permalink
Prepare release v0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange-42 committed Feb 7, 2025
1 parent 79fe590 commit 4a8fd35
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## [[unpublished]](https://github.com/mlange-42/modo/compare/v0.10.1...main)
## [[v0.11.0]](https://github.com/mlange-42/modo/compare/v0.10.1...v0.11.0)

### Features

Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const docsInDir = "src"
const docsOutDir = "site"
const testsDir = "test"
const gitignoreFile = ".gitignore"
const gitUrl = "blob/main"
const gitURL = "blob/main"

type config struct {
Warning string
Expand Down Expand Up @@ -116,7 +116,7 @@ func initProject(configFile string, initArgs *initArgs) error {
sourceURLs := map[string]string{}
for _, s := range sources {
sourceDirs = append(sourceDirs, path.Join(s.Path...))
sourceURLs[s.Name] = path.Join(path.Join(gitInfo.Repo, gitUrl), gitInfo.BasePath, path.Join(s.Path...))
sourceURLs[s.Name] = path.Join(path.Join(gitInfo.Repo, gitURL), gitInfo.BasePath, path.Join(s.Path...))
}

config := config{
Expand Down
1 change: 1 addition & 0 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/spf13/cobra"
)

// RootCommand creates the root command.
func RootCommand() (*cobra.Command, error) {
var showVersion bool

Expand Down
22 changes: 14 additions & 8 deletions internal/cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,23 @@ const initFileEmoji = "__init__.🔥"

var watchExtensions = []string{".md", ".mojo", ".🔥"}

// Version represents the version of Modo.
type Version struct {
Major int
Minor int
Patch int
Dev bool
Major int
Minor int
Patch int
Release bool
}

// NewVersion creates a new Version.
func NewVersion(major, minor, patch int, release bool) Version {
return Version{Major: major, Minor: minor, Patch: patch, Release: release}
}

// Version returns the version as a string.
func (v *Version) Version() string {
version := fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
if v.Dev {
version := fmt.Sprintf("v%d.%d.%d", v.Major, v.Minor, v.Patch)
if !v.Release {
version = fmt.Sprintf("%s-dev", version)
}
return version
Expand Down Expand Up @@ -75,9 +82,8 @@ func readDocs(file string) (*document.Docs, error) {
func read(file string) ([]byte, error) {
if file == "" {
return io.ReadAll(os.Stdin)
} else {
return os.ReadFile(file)
}
return os.ReadFile(file)
}

func isPackage(dir string) (isPackage bool, err error) {
Expand Down
7 changes: 1 addition & 6 deletions internal/cmd/version.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
package cmd

var version = Version{
Major: 0,
Minor: 10,
Patch: 2,
Dev: true,
}
var version = NewVersion(0, 11, 0, true)

0 comments on commit 4a8fd35

Please sign in to comment.