diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2023-06-24 08:52:32 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2023-06-24 08:52:46 +0800 |
commit | db8cda1e80e65b39e7d2d8b8f5f8a5b54c779181 (patch) | |
tree | ad03b1b4e668f9cbf0bc29c6f1700d11d852f9df | |
parent | 04b0b9e6e22f5ae1950831fd58ab5ee0a0600bde (diff) |
Update
-rw-r--r-- | zsh/zshrc | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -48,8 +48,11 @@ function _get_context() { | |||
48 | } | 48 | } |
49 | 49 | ||
50 | function _already_sync_after_wakeup() { | 50 | function _already_sync_after_wakeup() { |
51 | latest=$(date -d @`stat -c %Y ~/.wakeup` +%s) | 51 | WAKEUP=~/.wakeup |
52 | if [ $latest -gt $(cat ~/.wakeup) ]; then | 52 | [ ! -e "$WAKEUP" ] && return 0 |
53 | |||
54 | latest=$(date -d @`stat -c %Y "$WAKEUP` +%s) | ||
55 | if [ $latest -gt $(cat "$WAKEUP") ]; then | ||
53 | return 0 | 56 | return 0 |
54 | else | 57 | else |
55 | return 1 | 58 | return 1 |