Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Kluth <[email protected]>
  • Loading branch information
Alexander Kluth committed Jul 30, 2019
0 parents commit 0418e75
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor/
.idea/
Dofile
14 changes: 14 additions & 0 deletions Dofile.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description = "Dofile example"

[task]

[task.build]
commands = [
'echo "Ja hallo!',
'ls -l'
]

[task.clean]
commands = [
'echo "Ui ui ui ui ui!"',
]
33 changes: 33 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"

45 changes: 45 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package main

import (
"fmt"
"github.com/BurntSushi/toml"
"github.com/alexflint/go-arg"
. "github.com/logrusorgru/aurora"
"io/ioutil"
"log"
)

var args struct {
TaskName[] string `arg:"positional"`
}

type Dofile struct {
Description string
Tasks map[string]Task
}

type Task struct {
commands []string
}

func executeTask() {

}

func main() {
arg.MustParse(&args)

fileContents, err := ioutil.ReadFile("./Dofile")
if err != nil {
log.Fatal(err)
}

var doFile Dofile
if _, err := toml.Decode(string(fileContents), &doFile); err != nil {
log.Fatal(err)
}

for _, taskName := range args.TaskName {
fmt.Println(Bold(Green("Executing task")), Bold(Cyan(taskName)))
}
}

0 comments on commit 0418e75

Please sign in to comment.