Repository navigation
Feature: display banner only on the first run - #62
Conversation
|
Clippy works locally, so I blame GH's CI. 😅 |
avelino
left a comment
There was a problem hiding this comment.
Clean implementation, follows the existing compact_banner pattern. A few points before merge:
Tests
- Missing test for happy path:
one_time_banner = truegenerating stub withJBUNDLE_RUNSand[ ! -e ... ]logic - Missing test for default case:
one_time_banner = falsenot containingJBUNDLE_RUNS - Missing test for
compact_banner = true+one_time_banner = truecombination
Cleanup of ~/.jbundle/runs/
This directory will accumulate marker files indefinitely. At minimum document this, ideally clean up alongside jbundle clean.
Race condition
If two instances of the same binary run in parallel for the first time, both pass the [ ! -e ... ] check before the touch. Banner shows up twice. No need to fix now, but document as a known limitation
|
Hey @cereda, this one is a nice touch for CLI tools, thanks! I pushed a commit on your branch to merge The stub runs with
One note on order: this touches the same lines as #61, so I'd land #61 first and then I'll merge |
- a marker that can't be written (read-only HOME, sandbox) no longer kills the app under set -e; the banner shows and the app starts - banner logic moved to one_time_banner_block, JBUNDLE_RUNS only set when the option is on - tests: first run shows the banner, second run doesn't, read-only HOME still starts Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
- markers move to ~/.jbundle/cache/runs so jbundle clean removes them - test for compact_banner + one_time_banner together - document where markers live and the parallel first-run limitation Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
3d59ded to
0e3e7c3
Compare
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com> # Conflicts: # src/pack/stub.rs
Resolve conflicts with the banner_size option from avelino#61: one_time_banner now wraps whatever banner_size selects, and adds no marker when the banner is off. Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
Hopefully a better understanding of #39. 😉
Added
--one-time-bannertojbundle. When present, the underlying wrapper will use theapp_hashstring to look for a file of the same name inside${HOME}/.jbundle/runs. During the first app run, this file does not exist, so the banner is displayed as expected, and the file is created. Subsequent runs will check for the file, and since it exists, the banner will be omitted.I need some coffee now. ☕ 🦆