warren/cmd_deploy.go

46 lines
756 B
Go

package main
import (
"fmt"
"github.com/dballard/warren/src/warren"
"os"
)
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() {
_, err := os.Stat("deploy")
if err != nil {
os.Mkdir("deploy", os.ModeDir)
}
// does ./deploy/DST exist?
// if not make
}
func getDeployFilesList() []string {
name := warren.AppName()
return []string{name}
}
func deployRun(cmd *Command, args ...string) {
if len(args) > 0 && args[0] == "help" {
fmt.Print(cmd.Help)
return
}
checkDeployDir()
files := getDeployFilesList()
fmt.Println(files)
}