warren/cmd_deploy.go

46 lines
756 B
Go
Raw Normal View History

2014-12-10 07:04:49 +00:00
package main
import (
"fmt"
2014-12-12 07:13:55 +00:00
"github.com/dballard/warren/src/warren"
"os"
2014-12-10 07:04:49 +00:00
)
var deployUsage = `
warren deploy - Deploys the go server and support files
`
var deployCmd = &Command{
Name: "deploy",
Usage: "",
Summary: "deploy the go server and support files",
Help: deployUsage,
Run: deployRun,
}
func checkDeployDir() {
2014-12-12 07:13:55 +00:00
_, err := os.Stat("deploy")
if err != nil {
os.Mkdir("deploy", os.ModeDir)
}
// does ./deploy/DST exist?
// if not make
}
func getDeployFilesList() []string {
2014-12-12 07:13:55 +00:00
name := warren.AppName()
return []string{name}
}
2014-12-10 07:04:49 +00:00
func deployRun(cmd *Command, args ...string) {
if len(args) > 0 && args[0] == "help" {
fmt.Print(cmd.Help)
return
}
checkDeployDir()
2014-12-12 07:13:55 +00:00
files := getDeployFilesList()
2014-12-12 07:13:55 +00:00
fmt.Println(files)
2014-12-10 07:04:49 +00:00
}