|
56 | 56 | echo "";
|
57 | 57 | fi
|
58 | 58 |
|
| 59 | +# Create a .gitignore |
| 60 | +if test -f "$PROJECT_DIR/.gitignore"; then |
| 61 | + echo "The .gitignore file already exist. Skipping creating a new .gitignore."; |
| 62 | + echo ""; |
| 63 | +else |
| 64 | + echo "Creating a new .gitignore file..."; |
| 65 | + touch ".gitignore"; |
| 66 | + # Add default placeholder contents |
| 67 | + echo "\ |
| 68 | +# Project Specific |
| 69 | +bin/ |
| 70 | +bin/* |
| 71 | +
|
| 72 | +# If you prefer the allow list template instead of the deny list, see community template: |
| 73 | +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore |
| 74 | +# |
| 75 | +# Binaries for programs and plugins |
| 76 | +*.exe |
| 77 | +*.exe~ |
| 78 | +*.dll |
| 79 | +*.so |
| 80 | +*.dylib |
| 81 | +
|
| 82 | +# Test binary, built with `go test -c` |
| 83 | +*.test |
| 84 | +
|
| 85 | +# Output of the go coverage tool, specifically when used with LiteIDE |
| 86 | +*.out |
| 87 | +
|
| 88 | +# Dependency directories (remove the comment below to include it) |
| 89 | +# vendor/ |
| 90 | +
|
| 91 | +# Go workspace file (remove the comment below to include it) |
| 92 | +# go.work |
| 93 | +
|
| 94 | +# VS Code |
| 95 | +.vscode |
| 96 | +
|
| 97 | +# Local History for Visual Studio Code |
| 98 | +.history/ |
| 99 | +
|
| 100 | +# Built Visual Studio Code Extensions |
| 101 | +.vsix |
| 102 | +
|
| 103 | +" >> .gitignore; |
| 104 | + |
| 105 | + echo "Done." |
| 106 | + echo ""; |
| 107 | +fi |
| 108 | + |
59 | 109 | # Create a readme.md with placeholder
|
60 | 110 | if test -f "$PROJECT_DIR/readme.md"; then
|
61 | 111 | echo "The readme.md file already exist. Skipping creating a new readme.md.";
|
@@ -142,6 +192,17 @@ else
|
142 | 192 | echo "";
|
143 | 193 | fi
|
144 | 194 |
|
| 195 | +# Create a new "tests" folder if does not exist yet |
| 196 | +if test -d "$PROJECT_DIR/tests"; then |
| 197 | + echo "The tests directory exist. Skipping creating a new tests directory."; |
| 198 | + echo ""; |
| 199 | +else |
| 200 | + echo "Creating a new tests directory..."; |
| 201 | + mkdir -p "tests"; |
| 202 | + echo "Done." |
| 203 | + echo ""; |
| 204 | +fi |
| 205 | + |
145 | 206 | # Create a new "main.go" in "src" if does not exist yet
|
146 | 207 | if test -f "$PROJECT_DIR/src/main.go"; then
|
147 | 208 | echo "The main.go file exist. Skipping creating a main.go file.";
|
|
0 commit comments