template / ci-testing / files / default_config.go
Branch ci-testing · default branch · all branches
default_config.go
| 1 | package main |
| 2 | |
| 3 | func defaultConfig() Config { |
| 4 | config := Config{ |
| 5 | Profiles: []Profile{ |
| 6 | { |
| 7 | Name: "daily", |
| 8 | Description: "Creates a MD file in ~/DailyNotes folder in the format YYYY-MM-DD[-vX].md", |
| 9 | Path: "~/DailyNotes", |
| 10 | Type: FileType, |
| 11 | NamePatterns: []ParameterizedText{ |
| 12 | "{{$version := getVersion}}" + |
| 13 | "{{.Year}}-{{.Month}}-{{.Day}}" + |
| 14 | `{{if .ProjectName}}-{{.ProjectName | snakecase }}{{end}}` + |
| 15 | "{{if (gt $version 1)}}v{{$version}}{{end}}" + |
| 16 | ".md", |
| 17 | }, |
| 18 | File: File{ |
| 19 | Template: `# {{.FileNameWithoutExtension}} |
| 20 | |
| 21 | Today's notes for {{.Year}}-{{.Month}}-{{.Day}}. |
| 22 | |
| 23 | ## Todo |
| 24 | |
| 25 | 1. Check email |
| 26 | 2. Check chat |
| 27 | 3. Check calendar |
| 28 | 4. Check yesterday's notes |
| 29 | 5. Have fun! |
| 30 | 6. ADD MORE ITEMS HERE`, |
| 31 | }, |
| 32 | PostScripts: []ParameterizedText{ |
| 33 | "code . {{ if .FullPath }}\"{{.FullPath}}\"{{else}}(ls -t | head -n1){{ end }}", |
| 34 | }, |
| 35 | RunPostscriptOnFailure: true, |
| 36 | }, |
| 37 | { |
| 38 | Name: "note", |
| 39 | Description: "Creates a MD file in ~/Notes in the format YYYY-MM-DD[-ProjectName][-vVersion].md", |
| 40 | OS: "All", |
| 41 | Path: "~/Notes", |
| 42 | Type: FileType, |
| 43 | NamePatterns: []ParameterizedText{ |
| 44 | "{{$version := getVersion}}" + |
| 45 | "{{.Year}}-{{.Month}}-{{.Day}}" + |
| 46 | "{{if .ProjectName}}-{{.ProjectName}}{{end}}" + |
| 47 | "{{if (gt $version 1)}}n{{$version}}{{end}}" + |
| 48 | ".md", |
| 49 | }, |
| 50 | PostScripts: []ParameterizedText{ |
| 51 | "code \"{{.FullPath}}\"", |
| 52 | }, |
| 53 | }, |
| 54 | { |
| 55 | Name: "note-here", |
| 56 | Description: "Creates a MD file in the current folder in the format YYYY-MM-DD[-HH[-MM[-SS]]][-ProjectName][-vVersion].md", |
| 57 | OS: "All", |
| 58 | Type: FileType, |
| 59 | IsDefault: true, |
| 60 | Path: ".", // current folder |
| 61 | NamePatterns: []ParameterizedText{ |
| 62 | "{{$version := getVersion}}" + |
| 63 | "{{.Year}}-{{.Month}}-{{.Day}}" + |
| 64 | "{{if .ProjectName}}-{{.ProjectName}}{{end}}" + |
| 65 | "{{if (gt $version 1)}}n{{$version}}{{end}}" + |
| 66 | ".md", |
| 67 | "{{$version := getVersion}}" + |
| 68 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}" + |
| 69 | "{{if .ProjectName}}-{{.ProjectName}}{{end}}" + |
| 70 | "{{if (gt $version 1)}}n{{$version}}{{end}}" + |
| 71 | ".md", |
| 72 | "{{$version := getVersion}}" + |
| 73 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Second}}" + |
| 74 | "{{if .ProjectName}}-{{.ProjectName}}{{end}}" + |
| 75 | "{{if (gt $version 1)}}n{{$version}}{{end}}" + |
| 76 | ".md", |
| 77 | }, |
| 78 | PostScripts: []ParameterizedText{ |
| 79 | "code \"{{.FullPath}}\"", |
| 80 | }, |
| 81 | }, |
| 82 | { |
| 83 | Name: "blog", |
| 84 | Description: "Creates a MD file in the ~/Blog folder in the format YYYY-MM-DD[-ProjectName][-vVersion].md", |
| 85 | OS: "All", |
| 86 | Path: "~/Blog", |
| 87 | File: File{ |
| 88 | Template: `# {{.ProjectName}} |
| 89 | |
| 90 | Created by template, on {{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}. |
| 91 | |
| 92 | ## Spelling |
| 93 | |
| 94 | cspell:words nanite |
| 95 | |
| 96 | ## Removed writing |
| 97 | |
| 98 | ## Writing |
| 99 | `, |
| 100 | }, |
| 101 | Type: FileType, |
| 102 | NamePatterns: []ParameterizedText{ |
| 103 | "{{$version := getVersion}}" + |
| 104 | "{{.Year}}-{{.Month}}-{{.Day}}" + |
| 105 | `{{if .ProjectName}}-{{.ProjectName | snakecase }}{{end}}` + |
| 106 | "{{if (gt $version 1)}}v{{$version}}{{end}}" + |
| 107 | ".md", |
| 108 | }, |
| 109 | PostScripts: []ParameterizedText{ |
| 110 | "code . \"{{.FileName}}\"", |
| 111 | }, |
| 112 | }, |
| 113 | { |
| 114 | Name: "work-win", |
| 115 | Description: "Creates a folder in the c:/work folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]", |
| 116 | OS: "Windows", |
| 117 | Path: "C:/work", |
| 118 | Type: FolderType, |
| 119 | NamePatterns: []ParameterizedText{ |
| 120 | "{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 121 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 122 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 123 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 124 | }, |
| 125 | PostScripts: []ParameterizedText{ |
| 126 | "explorer \"{{.Path}}\"", |
| 127 | }, |
| 128 | }, |
| 129 | { |
| 130 | Name: "therapy", |
| 131 | Description: "Creates a MD file in the ~/Therapy folder in the format YYYY-MM-DD[-vVersion].md", |
| 132 | OS: "All", |
| 133 | Path: "~/Therapy", |
| 134 | File: File{ |
| 135 | Template: `# {{if .ProjectName}}{{.ProjectName}}{{else}}Therapy notes{{end}} |
| 136 | |
| 137 | {{if .ProjectName}}Therapy notes on {{.ProjectName}}{{else}}Therapy notes{{end}} |
| 138 | |
| 139 | ## Writing |
| 140 | |
| 141 | {{if .ProjectName}}Hello {{.ProjectName}},{{else}}Hello,{{end}} |
| 142 | |
| 143 | Start writing here... |
| 144 | |
| 145 | Sincerely, me |
| 146 | `, |
| 147 | }, |
| 148 | Type: FileType, |
| 149 | NamePatterns: []ParameterizedText{ |
| 150 | "{{$version := getVersion}}" + |
| 151 | "{{.Year}}-{{.Month}}-{{.Day}}" + |
| 152 | "{{if (gt $version 1)}}v{{$version}}{{end}}" + |
| 153 | ".md", |
| 154 | }, |
| 155 | PostScripts: []ParameterizedText{ |
| 156 | "code . {{.FullPath}}", |
| 157 | }, |
| 158 | }, |
| 159 | { |
| 160 | Name: "work", |
| 161 | Description: "Creates a folder in the ~/Work folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]", |
| 162 | Path: "~/Work", |
| 163 | Type: FolderType, |
| 164 | NamePatterns: []ParameterizedText{ |
| 165 | "{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 166 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 167 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 168 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 169 | }, |
| 170 | PostScripts: []ParameterizedText{ |
| 171 | "code .", |
| 172 | "chmod +x repro.sh", |
| 173 | }, |
| 174 | Files: []FileInFolder{ |
| 175 | { |
| 176 | File: File{ |
| 177 | Template: `# {{.ProjectName}} |
| 178 | |
| 179 | Work notes on {{.ProjectName}} |
| 180 | `, |
| 181 | }, |
| 182 | Name: "README.md", |
| 183 | }, |
| 184 | { |
| 185 | File: File{ |
| 186 | Template: `clear |
| 187 | |
| 188 | echo "Let's test {{.ProjectName}}!"`, |
| 189 | }, |
| 190 | Name: "repro.sh", |
| 191 | }, |
| 192 | { |
| 193 | File: File{ |
| 194 | Template: `{ |
| 195 | "version": "0.2.0", |
| 196 | "configurations": [ |
| 197 | { |
| 198 | "type": "bashdb", |
| 199 | "request": "launch", |
| 200 | "name": "Debug repo.sh", |
| 201 | "cwd": "${workspaceFolder}", |
| 202 | "program": "${workspaceFolder}/repro.sh", |
| 203 | "terminalKind": "integrated" |
| 204 | } |
| 205 | ] |
| 206 | } |
| 207 | `, |
| 208 | }, |
| 209 | Name: ".vscode/launch.json", |
| 210 | }, |
| 211 | }, |
| 212 | }, |
| 213 | { |
| 214 | Name: "folder", |
| 215 | Description: "Creates a folder in the current folder in the format YYYY-MM-DD[-ProjectName][-vVersion]", |
| 216 | Type: FolderType, |
| 217 | Path: ".", // current folder |
| 218 | PostScripts: []ParameterizedText{}, |
| 219 | NamePatterns: []ParameterizedText{ |
| 220 | "{{$version := getVersion}}" + |
| 221 | "{{.Year}}-{{.Month}}-{{.Day}}" + |
| 222 | "{{if .ProjectName}}-{{.ProjectName}}{{end}}" + |
| 223 | "{{if (gt $version 1)}}-n{{$version}}{{end}}", |
| 224 | }, |
| 225 | }, |
| 226 | { |
| 227 | Name: "create-react-app", |
| 228 | Type: FolderType, |
| 229 | Description: "Creates a folder in the current folder in the format create-react-app[-ProjectName][-vVersion], runs `npx create-react-app` to initialize the folder, and opens the folder in VSCode", |
| 230 | Path: ".", // current folder |
| 231 | NamePatterns: []ParameterizedText{ |
| 232 | "{{$version := getVersion}}" + |
| 233 | "create-react-app" + |
| 234 | "{{if .ProjectName}}-{{.ProjectName}}{{end}}" + |
| 235 | "{{if (gt $version 1)}}-n{{$version}}{{end}}", |
| 236 | }, |
| 237 | PostScripts: []ParameterizedText{ |
| 238 | "npx create-react-app .", |
| 239 | "code .", |
| 240 | }, |
| 241 | }, |
| 242 | { |
| 243 | Name: "git", |
| 244 | Description: "Creates a folder in the ~/code folder in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]", |
| 245 | Path: "~/code", |
| 246 | Type: FolderType, |
| 247 | NamePatterns: []ParameterizedText{ |
| 248 | "{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 249 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 250 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 251 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 252 | }, |
| 253 | PostScripts: []ParameterizedText{ |
| 254 | "git init", |
| 255 | "code .", |
| 256 | }, |
| 257 | }, |
| 258 | { |
| 259 | Name: "git-clone", |
| 260 | Description: "DISABLED - Clones a repository into a new folder under ~/code in the format YYYY-MM-DD[-hh][-mm][-ss][-ProjectName]", |
| 261 | IsDisabled: true, |
| 262 | Path: "~/code", |
| 263 | Type: FolderType, |
| 264 | NamePatterns: []ParameterizedText{ |
| 265 | "{{.Year}}-{{.Month}}-{{.Day}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 266 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 267 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 268 | "{{.Year}}-{{.Month}}-{{.Day}}-{{.Hour}}-{{.Minute}}-{{.Second}}{{if .ProjectName}}-{{.ProjectName}}{{end}}", |
| 269 | }, |
| 270 | PostScripts: []ParameterizedText{ |
| 271 | "git clone {{.Url}} .", |
| 272 | "code .", |
| 273 | }, |
| 274 | }, |
| 275 | }, |
| 276 | } |
| 277 | |
| 278 | return config |
| 279 | } |