mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Add special handling for mac os x (mojave/darwin18)
- date does not have option `--rfc-3339` - `rand` is not available, use `jot` instead
This commit is contained in:
parent
f05596fa1d
commit
a6d97365fc
1 changed files with 14 additions and 0 deletions
|
@ -2,12 +2,26 @@
|
||||||
|
|
||||||
function current_date()
|
function current_date()
|
||||||
{
|
{
|
||||||
|
case "${OSTYPE}" in
|
||||||
|
darwin*)
|
||||||
|
date "+%Y-%m-%d"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
date --rfc-3339=date
|
date --rfc-3339=date
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function random_minute()
|
function random_minute()
|
||||||
{
|
{
|
||||||
|
case "${OSTYPE}" in
|
||||||
|
darwin*)
|
||||||
|
echo "0$( jot 1 0 59 )" | sed "s|.\+\(..\)\$|\1|g"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
echo "0$( rand -M 60 )" | sed "s|.\+\(..\)\$|\1|g"
|
echo "0$( rand -M 60 )" | sed "s|.\+\(..\)\$|\1|g"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
function default_hours()
|
function default_hours()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue