deploy basics progress
This commit is contained in:
parent
c08f283f80
commit
7a503b2b52
|
@ -2,6 +2,8 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/dballard/warren/src/warren"
|
||||||
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
var deployUsage = `
|
var deployUsage = `
|
||||||
|
@ -17,15 +19,17 @@ var deployCmd = &Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkDeployDir() {
|
func checkDeployDir() {
|
||||||
// does ./deploy exist?
|
_, err := os.Stat("deploy")
|
||||||
// if not make
|
if err != nil {
|
||||||
|
os.Mkdir("deploy", os.ModeDir)
|
||||||
|
}
|
||||||
// does ./deploy/DST exist?
|
// does ./deploy/DST exist?
|
||||||
// if not make
|
// if not make
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDeployFilesList() []string {
|
func getDeployFilesList() []string {
|
||||||
|
name := warren.AppName()
|
||||||
return []string{""}
|
return []string{name}
|
||||||
}
|
}
|
||||||
|
|
||||||
func deployRun(cmd *Command, args ...string) {
|
func deployRun(cmd *Command, args ...string) {
|
||||||
|
@ -35,7 +39,7 @@ func deployRun(cmd *Command, args ...string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
checkDeployDir()
|
checkDeployDir()
|
||||||
|
files := getDeployFilesList()
|
||||||
|
|
||||||
//files := getDeployFilesList()
|
fmt.Println(files)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,9 @@ package warren
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -21,3 +23,9 @@ func GitBranch() string {
|
||||||
}
|
}
|
||||||
return strings.TrimSpace(string(gitbranch))
|
return strings.TrimSpace(string(gitbranch))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func AppName() string {
|
||||||
|
paths, _ := filepath.Abs(filepath.Dir(os.Args[0]))
|
||||||
|
paths, name := filepath.Split(paths)
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue