plans: fix done cmd

This commit is contained in:
Daniella / Tove 2024-10-30 01:20:16 +01:00
parent 179881b9dc
commit b9f6237786
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -6,7 +6,8 @@ pkgs.writeShellScriptBin "plans" ''
echo "- $2" >> ~/sync/plans.txt echo "- $2" >> ~/sync/plans.txt
fi fi
if [ "$1" = "done" ] ; then if [ "$1" = "done" ] ; then
tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt tail -n"$(($(wc -l < ~/sync/plans.txt) - 1))" ~/sync/plans.txt > ~/plans.txt.tmp
mv ~/plans.txt.tmp ~/sync/plans.txt
fi fi
if [ "$1" = "edit" ] ; then if [ "$1" = "edit" ] ; then
hx ~/sync/plans.txt hx ~/sync/plans.txt