Skip to content

Commit

Permalink
feat: print version number
Browse files Browse the repository at this point in the history
  • Loading branch information
polarhive committed Apr 6, 2024
1 parent c2576f4 commit 1eb8e48
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ This project is a part of the ACM PESU-ECC's yearly [AIEP](https://acmpesuecc.gi
---
## Install

Once you have a directory structure, install `anna` using:

```sh
go install github.com/acmpesuecc/[email protected]
go run github.com/acmpesuecc/[email protected]
```

Alternatively, clone our repository to build the latest version of anna:
Expand All @@ -52,6 +50,5 @@ Flags:
-h, --help help for anna
-p, --prof enable profiling
-s, --serve serve the rendered content
-v, --validate-html validate semantic HTML
-w, --webconsole wizard to setup anna
```
14 changes: 9 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
package main

import (
"fmt"
"log"
"os/exec"
"strings"
"time"

"github.com/acmpesuecc/anna/cmd/anna"
Expand All @@ -13,7 +16,7 @@ func main() {
var addr string
var webconsole bool
var renderDrafts bool
var validateHTML bool
var version bool
var prof bool

rootCmd := &cobra.Command{
Expand All @@ -38,9 +41,10 @@ func main() {
anna.RunProfilingServer()
}

if validateHTML {
// anna.ValidateHTMLContent()
cmd.Println("TODO: To be filled later")
if version, err := exec.Command("git", "describe", "--tags").Output(); err == nil {
fmt.Println("Current version:", strings.TrimSpace(string(version)))
} else {
fmt.Println("Error:", err)
}

if webconsole {
Expand All @@ -58,7 +62,7 @@ func main() {
rootCmd.Flags().BoolVarP(&serve, "serve", "s", false, "serve the rendered content")
rootCmd.Flags().StringVarP(&addr, "addr", "a", "8000", "ip address to serve rendered content to")
rootCmd.Flags().BoolVarP(&renderDrafts, "draft", "d", false, "renders draft posts")
rootCmd.Flags().BoolVarP(&validateHTML, "validate-html", "v", false, "validate semantic HTML")
rootCmd.Flags().BoolVarP(&version, "version", "v", false, "prints current version number")
rootCmd.Flags().BoolVarP(&prof, "prof", "p", false, "enable profiling")
rootCmd.Flags().BoolVarP(&webconsole, "webconsole", "w", false, "wizard to setup anna")

Expand Down
4 changes: 2 additions & 2 deletions site/layout/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ navbar:
- tags
- posts
baseURL: https://anna-docs.netlify.app
siteTitle: ssg
siteTitle: "anna-docs"
siteScripts:
author: Anna
author: anna
themeURL: "/static/style.css"

0 comments on commit 1eb8e48

Please sign in to comment.