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

Problem with todo after upgrading #124

Closed
2 tasks done
mirfilip opened this issue Aug 28, 2017 · 7 comments
Closed
2 tasks done

Problem with todo after upgrading #124

mirfilip opened this issue Aug 28, 2017 · 7 comments

Comments

@mirfilip
Copy link

Issue Label:

  • Bug

Description:
I worked with 1.17.2 version of todo:

todo -v
Version 1.17.2

My todo list had 21 elements. I realised the version is quite old, so I decided to bump it:

brew upgrade bash-snippets
...
todo -v
Version 1.19.0

Now, todo fails to do anything with the existing list:

todo -g
/usr/local/bin/todo: line 144: 08: value too great for base (error token is "08")

Looks like some kind of BC break.

OS and OS version:

  • Mac

OS Version:
OS Version: 10.12.5

@alexanderepstein
Copy link
Owner

I am not sure but there is chance that the update was not backwards compatible since #119 you can see your tasks manually with

cat ~/. todo/list.txt

They will not be numbered however. You can copy this list somewhere else and then run the todo clear command to erase the list file. Than try to add new elements to the newly created todo list and see if those are accessible with either todo -g or todo list

@alexanderepstein
Copy link
Owner

You can also add tasks like todo add task stuff goes here and todo clear is valid as well.

@alexanderepstein
Copy link
Owner

Although this not the first time I have seen this error it generally stems from me switching some logic around and clearing the list seems to work.

@mirfilip
Copy link
Author

mirfilip commented Aug 29, 2017

Sure, I use ~/.todo/list.txt manually as for now.

I copied the list to ~/.todo/list.txt.bak, did todo clear. Now, I have a funny situation:

 todo clear
Tasks cleared.
todo -g
No tasks found
todo -a 'my new task'
<my old tasks are listed here>
my new task
todo -g
my new task

See ^. After adding, old tasks were listed too. Now, if I add another one, it displays only two new tasks (both after adding and via -g).

Although this not the first time I have seen this error it generally stems from me switching some logic around and clearing the list seems to work.
I'd be awesome if you always try to be backward compatible, if not, maybe add a warning or sth.

If clearing the list and starting over is an official workaround, you can close it.

@mirfilip
Copy link
Author

mirfilip commented Aug 29, 2017

Ok, it's not done.

When trying to add 8th task:

todo -a 'some task'
/usr/local/bin/todo: line 144: 08: value too great for base (error token is "08")

"some task" was still added to ~/.todo/list.txt.

@alexanderepstein
Copy link
Owner

alexanderepstein commented Aug 29, 2017

Not sure why the 08 thing is an error but it is an easy fix that I applied here 608cab1

As for the other error that seems very strange, it has been a little so I don't remember exactly what the difference in the logic is but I do remember that I did not build it to be able to handle bulk removal. When I added this option a lot of logic had to move around to make this work, I still don't think it should have broken backwards compatibility but its very possible.

A solution to prevent any future errors (except the one you currently see about the 08 until the update comes out) would be just to move the current todo list file to the trash rm -f ~/.todo/list.txt None of the previous errors you mentioned should occur after that (I hope so lol)

@alexanderepstein
Copy link
Owner

Released with Version 1.19.1 this has already been merged over to homebrew-core 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants