Skip to content

Commit

Permalink
Use busybox compatible commands for completion
Browse files Browse the repository at this point in the history
 - use portable call to date(1)
 - use plain stat(1) for ctime
 - don't use mv -u
  • Loading branch information
nephros committed Feb 14, 2024
1 parent 0f47ce9 commit dd712bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/osc.complete
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ fi
update_projects_list ()
{
if test -s "${projects}" ; then
typeset -i ctime=$(command date -d "$(command stat -c '%z' ${projects})" +'%s')
typeset -i now=$(command date -d now +'%s')
typeset -i ctime=$(command stat -c '%Z' ${projects})
typeset -i now=$(command date +'%s')
if ((now - ctime > 86400)) ; then
if tmp=$(mktemp ${projects}.XXXXXX) ; then
command ${command} ls / >| $tmp
mv -uf $tmp ${projects}
mv -f $tmp ${projects}
fi
fi
else
Expand Down

0 comments on commit dd712bb

Please sign in to comment.