Skip to content

Commit

Permalink
find tape + cleanup fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasvanEyk committed Jul 7, 2023
1 parent 00c902a commit 4e08d6e
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ go build -o changelog
#### `changelog find`

Finds the nearest `CHANGELOG.md` relative to the current working directory and prints it to the console.

<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://niclasvaneyk.github.io/keepac/find.dark.gif">
<img src="https://niclasvaneyk.github.io/keepac/find.light.gif" loading="lazy">
</picture>

If none is found, keepac will recursively walk upwards the directory tree until it either reaches the root or finds one.

> Note: "The nearest changelog" will be used throughout this readme to refer to this upward search for `CHANGELOG.md` files.
Expand Down
51 changes: 51 additions & 0 deletions tapes/dark/find.tape
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
Source ../partials/config.tape
Require tree

Hide
Type "mkdir init-demo"
Sleep 100ms
Enter
Type "changelog init"
Sleep 100ms
Enter
Type "clear"
Sleep 100ms
Enter
Show

Type "ls"
Sleep 100ms
Enter
Sleep 2500ms

Type "changelog find"
Sleep 100ms
Enter
Sleep 2500ms

Type "mkdir -p some/deeply/nested/directory"
Sleep 100ms
Enter
Sleep 2500ms

Type "cd some/deeply/nested/directory"
Sleep 100ms
Enter
Sleep 2500ms

Type "changelog find"
Sleep 100ms
Enter
Sleep 2500ms

Type "# Still finds the 'nearest' CHANGELOG.md!"
Sleep 5000ms
Enter

Hide
Type "cd ../../../.."
Sleep 100ms
Enter
Type "rm -rf init-demo"
Sleep 100ms
Enter
1 change: 1 addition & 0 deletions tapes/dark/search.tape
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ Sleep 10000ms

Hide
Type "rm CHANGELOG.md"
Enter

2 changes: 2 additions & 0 deletions tapes/dark/show.tape
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Sleep 15000ms

Hide
Type "rm CHANGELOG.md"
Enter

0 comments on commit 4e08d6e

Please sign in to comment.