utkuufuk / budget-cli

Manage your Google budget spreadsheets from terminal
https://utkuufuk.com/2018/11/10/budget-cli
MIT License
34 stars 6 forks source link

Add transactions in batch through text #13

Closed Grommers00 closed 5 years ago

Grommers00 commented 5 years ago

Closes #12

I created a new command for parsing a file. It then goes through the loop of a file and will sequentially add them to your spreadsheets. It takes into consideration for comments in the code as well, so you as long as you # the beginning of the line in the text file it would be able to do this.

To use this the command: budget insert \PATH\TO\FILE

utkuufuk commented 5 years ago

@Grommers00 Good work so far 👍

Here's what I did:

There's a problem though; I can only give absolute paths as the argument. I want to be able to pass relative paths too. We can merge this after that is taken care of.

Grommers00 commented 5 years ago

Ah - Yeah, I ran into that issue at the beginning, and I found it would work in the .budget-cli folder, as a relative. I'm open to suggestions - but that was the CWD when I checked.

utkuufuk commented 5 years ago

@Grommers00 Before reading the file, you have to temporarily change the CWD as the directory where the user is currently running the budget insert command.

I don't know how to do it, but it shouldn't be difficult.

utkuufuk commented 5 years ago

@Grommers00 Nevermind, I just fixed it. It turns out I forgot to restore the CWD after building the sheet service.