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

Add transactions in batch through text #13

Merged
merged 7 commits into from Oct 16, 2019
Merged

Conversation

Grommers00
Copy link
Contributor

@Grommers00 Grommers00 commented Oct 16, 2019

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
Copy link
Owner

@Grommers00 Good work so far 👍

Here's what I did:

  • Added error handling so that any incorrect commands in the file won't prevent the following commands from being executed.
  • Removed capability to add comments in transaction file, simply because there's no need.
  • Polished styling & renamed some variables.

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.

@utkuufuk utkuufuk changed the title fix 12 - Add transactions in batch through text Add transactions in batch through text Oct 16, 2019
@Grommers00
Copy link
Contributor Author

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
Copy link
Owner

@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
Copy link
Owner

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

@utkuufuk utkuufuk self-requested a review October 16, 2019 19:57
@utkuufuk utkuufuk merged commit b338973 into utkuufuk:master Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add transactions in batch through text file
2 participants