diff --git a/.gitea/pull_request_template.md b/.gitea/pull_request_template.md deleted file mode 100644 index f4def42..0000000 --- a/.gitea/pull_request_template.md +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/DOCS.md b/DOCS.md index 7a3f2b9..638b13b 100644 --- a/DOCS.md +++ b/DOCS.md @@ -119,13 +119,4 @@ I realize that many users will be using GitHub, and most will likely still be us 1. The simplest solution is to make a copy of your `registry.toml` (default: `~/.tmpl/registry.toml`). * Once in the new location, you will need to use `tmpl restore`. -2. Alternatively, you can copy/paste the entire registry (default: `~/.tmpl`) and skip the restore step. - -## `.tmplkeep` - -Perhaps you are familiar with `.gitkeep` and its unofficial status in git. Git does not like empty directories, so usually -a `.gitkeep` (or just `.keep`) file is added to retain the directory while keeping it effectively empty. - -tmpl instead uses `.tmplkeep` files for this purpose. The difference is, tmpl will **not** create the `.tmplkeep` file -when the template is executed. This allows you to set up directory structures (for staging, examples, etc.) that -will *actually* be empty after execution. \ No newline at end of file +2. Alternatively, you can copy/paste the entire registry (default: `~/.tmpl`) and skip the restore step. \ No newline at end of file diff --git a/docs.go b/docs.go index aa13bf6..3ca29f5 100644 --- a/docs.go +++ b/docs.go @@ -28,7 +28,7 @@ func main() { md = md[strings.Index(md, "#"):] // CLI is using real default instead of DefaultText - md = regexp.MustCompile(`[\/\\:\w]+\.tmpl`).ReplaceAllString(md, "~/.tmpl") + md = regexp.MustCompile(`[\/\w]+\.tmpl`).ReplaceAllString(md, "~/.tmpl") if _, err := fi.WriteString(md); err != nil { panic(err) diff --git a/registry/registry_test.go b/registry/registry_test.go index 628e29d..8adc7ca 100644 --- a/registry/registry_test.go +++ b/registry/registry_test.go @@ -98,8 +98,7 @@ func setupTemplate() { if err := os.MkdirAll(pkgPath, os.ModePerm); err != nil { panic(err) } - // .tmplkeep file - fi, err = os.Create(filepath.Join(pkgPath, ".tmplkeep")) + fi, err = os.Create(filepath.Join(pkgPath, ".keep")) if err != nil { panic(err) } diff --git a/registry/template.go b/registry/template.go index 76bf84c..938eff0 100644 --- a/registry/template.go +++ b/registry/template.go @@ -85,11 +85,6 @@ func (t *Template) Execute(dest string, defaults, overwrite bool) error { return err } - // Skip .tmplkeep files, after creating the directory structure - if strings.EqualFold(walkInfo.Name(), ".tmplkeep") { - return nil - } - oldFi, err := os.Lstat(walkPath) if err != nil { return err diff --git a/registry/template_test.go b/registry/template_test.go index a51717b..dd8c317 100644 --- a/registry/template_test.go +++ b/registry/template_test.go @@ -72,13 +72,6 @@ func testExecute(t *testing.T) { t.FailNow() } - // Check for .tmplkeep - tmplKeep := filepath.Join(pkgPath, ".tmplkeep") - if _, err := os.Lstat(tmplKeep); err == nil { - t.Logf(".tmplkeep files should NOT be retained upon execution: %s\n", tmplKeep) - t.FailNow() - } - // Change file to test non-overwrite if err := ioutil.WriteFile(testPath, []byte(tmplNewGold), os.ModePerm); err != nil { t.Logf("could not write file: %v\n", err)