Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into upstream/v0.1.11-al…
Browse files Browse the repository at this point in the history
…ignment
  • Loading branch information
furan917 committed Nov 24, 2023
2 parents 7830796 + 5060a6b commit 84a63f7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
token: ${{ secrets.PAT_TOKEN }}
release-type: go
package-name: "MageComm"
extra-files: |
version.txt
- name: Log release info
run: |
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [0.1.11](https://github.com/furan917/MageComm/compare/v0.1.10...v0.1.11) (2023-11-24)


### Bug Fixes

* Add release pleas comment to version file ([b31cc8d](https://github.com/furan917/MageComm/commit/b31cc8d9c0641913fe134a24f543f6478251fb26))
* add version command properly ([db3df42](https://github.com/furan917/MageComm/commit/db3df42d65a7603f9039fe6a5a5cae4d69ecceeb))
* ensure version output is displayed without comment ([e79e230](https://github.com/furan917/MageComm/commit/e79e230ea70d70069517f79072cc5cba7e59a0da))

## [0.1.10](https://github.com/furan917/MageComm/compare/v0.1.9...v0.1.10) (2023-11-23)


Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ config file can be in yaml or json format e.g `config.yml` or `config.json`, ple

Download the latest release from the [releases page](https://github.com/furan917/magecomm/releases) for your platform and extract to a directory in your PATH.

Then check your installed version with `magecomm version`

example config.yml:
```
disallow_configfile_overwrite: true
Expand Down
16 changes: 14 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
package main

import (
_ "embed"
"fmt"
"github.com/spf13/cobra"
"magecomm/cmd"
"magecomm/config_manager"
"magecomm/logger"
"magecomm/notifictions"
"magecomm/services"
"os"
"strings"
)

//go:embed version.txt
var version string

var RootCmd = &cobra.Command{
Use: "magecomm",
Short: "MageComm CLI is a command line tool for managing Magento applications",
PersistentPreRun: func(cmd *cobra.Command, args []string) {

debug, _ := cmd.Flags().GetBool("debug")
if debug {
logger.EnableDebugMode()
Expand All @@ -33,11 +38,18 @@ func initializeModuleWhichRequireConfig() {
}

func main() {
if len(os.Args) > 1 && os.Args[1] == "version" {
//Remove the release-please comment from the version output
version = strings.Split(version, "##")[0]
fmt.Printf("Magecomm Version: %s\n", strings.TrimSpace(version))
return
}

RootCmd.AddCommand(cmd.ListenCmd)
RootCmd.AddCommand(cmd.MagerunCmd)
//RootCmd.AddCommand(cmd.DeployCmd)
RootCmd.AddCommand(cmd.CatCmd)
//RootCmd.AddCommand(cmd.CatDeployCmd)
//RootCmd.AddCommand(cmd.DeployCmd)

RootCmd.PersistentFlags().String("config", "", "Path to config file")
RootCmd.PersistentFlags().Bool("debug", false, "Enable debug mode")
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v0.1.11 ## x-release-please-version

0 comments on commit 84a63f7

Please sign in to comment.