Skip to content

Commit afb30a4

Browse files
author
Francis Bouvier
committed
Add basic go-thrust command tool
Signed-off-by: Francis Bouvier <francis.bouvier@xerus-technologies.fr>
1 parent 59ae10c commit afb30a4

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

main.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"os"
6+
7+
"github.com/codegangsta/cli"
8+
"github.com/miketheprogrammer/go-thrust/lib/spawn"
9+
)
10+
11+
func install(c *cli.Context) {
12+
spawn.SetBaseDirectory("") // Default to usr.homedir.
13+
tp := spawn.NewThrustProvisioner()
14+
if err := tp.Provision(); err != nil {
15+
panic(err)
16+
}
17+
fmt.Println("Thrust installed")
18+
}
19+
20+
func main() {
21+
app := cli.NewApp()
22+
app.Name = "go-thrust"
23+
app.Usage = "Tools to developp Thrust applications in Go"
24+
25+
app.Commands = []cli.Command{
26+
{
27+
Name: "install",
28+
ShortName: "i",
29+
Usage: "Install Thrust",
30+
Action: func(c *cli.Context) {
31+
install(c)
32+
},
33+
},
34+
}
35+
36+
app.Run(os.Args)
37+
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)