Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
fixed home directory selection
Browse files Browse the repository at this point in the history
  • Loading branch information
josehelps committed Jun 22, 2018
1 parent f51a133 commit 8543e3f
Show file tree
Hide file tree
Showing 6 changed files with 218 additions and 2 deletions.
8 changes: 7 additions & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@
[prune]
go-tests = true
unused-packages = true

[[constraint]]
branch = "master"
name = "github.com/mitchellh/go-homedir"
21 changes: 21 additions & 0 deletions vendor/github.com/mitchellh/go-homedir/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions vendor/github.com/mitchellh/go-homedir/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

155 changes: 155 additions & 0 deletions vendor/github.com/mitchellh/go-homedir/homedir.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion waflyctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"strconv"
"strings"
"time"
"os/user"
)

var (
Expand All @@ -39,8 +40,14 @@ var (
// version number
version = "dev"
date = "unknown"

//Home Directory
HOMEDIRECTORY string

)



// TOMLConfig is the applications config file
type TOMLConfig struct {
Logpath string
Expand Down Expand Up @@ -1189,13 +1196,22 @@ func PatchRules(serviceID, wafID string, client fastly.Client) bool {

func main() {

// grab a users home directory
user, err := user.Current()
if err != nil {
fmt.Println("error reading current user name : %s", err)
os.Exit(1)
}

HOMEDIRECTORY := user.HomeDir

domain := flag.String("domain", "", "[Required] Domain to Provision, you can use Service ID alternatively")
serviceID := flag.String("serviceid", "", "[Required] Service ID to Provision")
apiKey := flag.String("apikey", "", "[Required] API Key to use")
apiEndpoint := flag.String("apiendpoint", "https://api.fastly.com", "Fastly API endpoint to use.")
//emergency := flag.Bool("emergency", false, "is this an emergency provisioning..see [wiki link]")
//ssl := flag.Bool("ssl", false, "turn on ssl for this domain..see [wiki link]")
configFile := flag.String("config", "~/.waflyctl.toml", "Location of configuration file for waflyctl.")
configFile := flag.String("config", HOMEDIRECTORY + "/.waflyctl.toml", "Location of configuration file for waflyctl.")

//var blocklist string
//flag.StringVar(&blocklist, "blocklist", "gcp,aws,azure,aws,TOR", "Which blocklist should we provisioned on block mode in a comma delimited fashion. Available choices are: [for look here]")
Expand Down

0 comments on commit 8543e3f

Please sign in to comment.