summaryrefslogtreecommitdiff
path: root/src/upgrade.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/upgrade.zig')
-rw-r--r--src/upgrade.zig15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/upgrade.zig b/src/upgrade.zig
index 49e8aff5..37c79991 100644
--- a/src/upgrade.zig
+++ b/src/upgrade.zig
@@ -74,11 +74,18 @@ fn inodeOf(path: [:0]const u8) ?u64 {
/// rebuilding (a stat). ponytail: explicit only, no watch and no automatic
/// upgrade.
pub fn noticeNewer(core: *pardes.Pardes) void {
- const was = started_inode orelse return;
- const now = inodeOf(exe() orelse return) orelse return;
- if (now == was or told_inode == now) return;
+ if (newer()) core.setMessage(core.active, pardes.newer_build_words);
+}
+
+/// Whether to say a newer build is installed now (`noticeNewer`): the
+/// tty's Host answers the core's focus step with it, so its replica
+/// clients take the line from the tape.
+pub fn newer() bool {
+ const was = started_inode orelse return false;
+ const now = inodeOf(exe() orelse return false) orelse return false;
+ if (now == was or told_inode == now) return false;
told_inode = now;
- core.setMessage(core.active, "a newer pardes is installed: Upgrade (SPC s U) moves this session onto it");
+ return true;
}
pub fn exe() ?[:0]const u8 {