deploy basics progress

This commit is contained in:
Dan Ballard 2014-12-11 23:13:55 -08:00
parent c08f283f80
commit 7a503b2b52
2 changed files with 18 additions and 6 deletions

View File

@ -2,6 +2,8 @@ package main
import (
"fmt"
"github.com/dballard/warren/src/warren"
"os"
)
var deployUsage = `
@ -17,15 +19,17 @@ var deployCmd = &Command{
}
func checkDeployDir() {
// does ./deploy exist?
// if not make
_, err := os.Stat("deploy")
if err != nil {
os.Mkdir("deploy", os.ModeDir)
}
// does ./deploy/DST exist?
// if not make
}
func getDeployFilesList() []string {
return []string{""}
name := warren.AppName()
return []string{name}
}
func deployRun(cmd *Command, args ...string) {
@ -35,7 +39,7 @@ func deployRun(cmd *Command, args ...string) {
}
checkDeployDir()
files := getDeployFilesList()
//files := getDeployFilesList()
fmt.Println(files)
}

View File

@ -2,7 +2,9 @@ package warren
import (
"log"
"os"
"os/exec"
"path/filepath"
"strings"
)
@ -21,3 +23,9 @@ func GitBranch() string {
}
return strings.TrimSpace(string(gitbranch))
}
func AppName() string {
paths, _ := filepath.Abs(filepath.Dir(os.Args[0]))
paths, name := filepath.Split(paths)
return name
}