Added support for single file builds
This commit is contained in:
parent
d04c216dc2
commit
423526e567
4 changed files with 57 additions and 24 deletions
|
@ -10,7 +10,7 @@ import (
|
|||
|
||||
// Build builds an executable.
|
||||
func Build(args []string) int {
|
||||
b := build.New(".")
|
||||
b := build.New()
|
||||
|
||||
for i := 0; i < len(args); i++ {
|
||||
switch args[i] {
|
||||
|
@ -26,10 +26,14 @@ func Build(args []string) int {
|
|||
return 2
|
||||
}
|
||||
|
||||
b.Directory = args[i]
|
||||
b.Files = append(b.Files, args[i])
|
||||
}
|
||||
}
|
||||
|
||||
if len(b.Files) == 0 {
|
||||
b.Files = append(b.Files, ".")
|
||||
}
|
||||
|
||||
err := b.Run()
|
||||
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue