Skip to content

Commit 271fb23

Browse files
authored
Switch to using .tomeignore file (#3)
* Switch to using .tomeignore file * Include a .tomeignore file in repo
1 parent 2578b77 commit 271fb23

File tree

8 files changed

+10
-5
lines changed

8 files changed

+10
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ See [docs](./docs/tome-cli.md) for expanded instructions
4545
- root folder's folder names
4646
- root folder's scripts
4747
- root script's flags and arguments (when they satisfy the --complete and TOME_COMPLETION interface)
48-
- Gitignore like syntax for ignoring scripts by using a `.tome_ignore` file at base of root folder
48+
- Gitignore like syntax for ignoring scripts by using a `.tomeignore` file at base of root folder [example](./cmd/embeds/.tomeignore)
4949

5050
# Capabilities
5151

cmd/alias.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ type ScriptTemplate struct {
1818
Root string
1919
}
2020

21-
//go:embed tome-wrapper.sh.tmpl
21+
//go:embed embeds/tome-wrapper.sh.tmpl
22+
//go:embed embeds/.tomeignore
2223
var content embed.FS
2324

2425
var writePath string
@@ -52,7 +53,7 @@ Read the template script 'tome-wrapper.sh.tmpl' for more information on how the
5253
ExecutableAlias: config.ExecutableName(),
5354
Root: config.RootDir(),
5455
}
55-
t, err := template.ParseFS(content, "tome-wrapper.sh.tmpl")
56+
t, err := template.ParseFS(content, "embeds/tome-wrapper.sh.tmpl")
5657
// Capture any error
5758
if err != nil {
5859
log.Fatalln(err)

cmd/embeds/.tomeignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore 'hidden' files
2+
.*

cmd/struct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func NewConfig() *Config {
138138
}
139139

140140
func (c *Config) IgnorePatterns() *gitignore.GitIgnore {
141-
tomeIgnore := ".tome_ignore"
141+
tomeIgnore := ".tomeignore"
142142
tomeIgnorePath := filepath.Join(c.RootDir(), tomeIgnore)
143143
_, err := os.Stat(tomeIgnorePath)
144144
if err == nil {

examples/.tome_ignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/.tomeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
folder/executable-ignored
2+
# Ignore any files starting with leading period to respect "hidden" files
3+
.*

examples/folder/.ignored/executable

Whitespace-only changes.

0 commit comments

Comments
 (0)