Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fight: also show date #29

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/fight/fight.fish
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,17 @@ end


if [ $oldHash != $newHash ]
echo $input
set epoch (echo $data | jq -r ".locked.lastModified") # Time of last revision in Epoch time

set then (date --date "@$epoch" --iso-8601=hours)
set now (date --date now --iso-8601=hours)

set days (datediff $then $now -f "%d")
set hours (datediff $then $now -f "%h")

if [ $days = 0 ]
echo "$input (from $hours hours ago)"
else
echo "$input (from $days days ago)"
end
end
1 change: 1 addition & 0 deletions packages/fight/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ llakaLib.writeFishApplication
[
git
jq
dateutils
];

text = builtins.readFile ./fight.fish;
Expand Down