-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
920 additions
and
1,004 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
[*.go] | ||
indent_style = tab | ||
|
||
[*.twig] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"os/user" | ||
"path/filepath" | ||
"strings" | ||
) | ||
|
||
var templateDir = func() string { | ||
var gopath = os.Getenv("GOPATH") | ||
if gopath == "" { | ||
usr, err := user.Current() | ||
if err != nil { | ||
fmt.Fprintf(os.Stderr, "cannot determine home dir: %s\n", err.Error()) | ||
os.Exit(1) | ||
} | ||
gopath = filepath.Join(usr.HomeDir, "go") | ||
} | ||
for _, path := range strings.Split(gopath, ":") { | ||
if path != "" { | ||
abspath, _ := filepath.Abs(filepath.Join(path, "src", "github.com", "vektah", "graphql-go")) | ||
fmt.Println(abspath) | ||
if dirExists(abspath) { | ||
return abspath | ||
} | ||
} | ||
} | ||
|
||
fmt.Fprintln(os.Stderr, "cannot determine base of github.com/vektah/grapqhl-go") | ||
os.Exit(1) | ||
return "" | ||
}() | ||
|
||
func dirExists(path string) bool { | ||
fi, err := os.Stat(path) | ||
return !os.IsNotExist(err) && fi.IsDir() | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.