-
What would be the best way to do this with bkt, if possible: I want to run a command which requires online mode: either internet access or a volume to be mounted. If online, then great, the output of the command is displayed and cached by bkt. If offline, then the command either returns a specific exit code or specific output, which bkt detects and thus outputs the cached output from the last successful (online) invocation, plus a clear indication that this cached output is an "offline cache" that is "X minutes", "X hours" old (up to 24 hours, beyond which a simple ISO8601 date is printed to show how stale this cached output is). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
#24 sounds related, if you'd like to weigh in there. I am open to adding something like this, it's not quite what you're asking about but maybe you'd be able to use it. I don't anticipate adding support to That said, there are a few things you could consider:
One last thing to call out; it's possible you can get something simpler working without |
Beta Was this translation helpful? Give feedback.
#24 sounds related, if you'd like to weigh in there. I am open to adding something like this, it's not quite what you're asking about but maybe you'd be able to use it.
I don't anticipate adding support to
bkt
to detect something like "is offline" since that's a fairly complex thing to detect in general (as simple as it seems when talking colloquially about it 🙂) and because I wantbkt
to remain agnostic to the commands it executes and caches. Similarly, I don't have plans to add behavior tobkt
to output different content when a result is cached vs. fresh - it is intended to be transparent to callers. The command could obviously output when it ran (e.g. viadate
), but it wouldn't be able…