Feat: Upload multiple files, upload directory #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey! I love this uploader, and now that I've been learning Go I thought I'd give adding some functionality a shot. I'm sorry if I'm doing something wrong - I'm new to contributing. Please let me know if there's any issues and I'll handle them :)
If you do decide you'd like to merge the request you'll have to let me know how you generate the CLI usage screenshot! I couldn't figure out what tool you used to update the README.
New Features
-dir
flag that accepts a directory then uploads all files inside the directory (non-recursive... maybe later haha)To make the
-dir
flag work, the script now loops all args/directory files first and for each of those it runs the upload code and stores them in a slice for later. Once done, if there's only one file uploaded it'll print the upload URL and copy it to the clipboard, but if there's multiple files it'll print a table with the file name and the uploaded URL and store them in a log file.I've done some small refactors where necessary, like updating deprecated function calls and moving some code to separate functions to make reading the main loop easier.
That's it I think. Code should be pretty self-explanatory but, like I said, I'm new to Go so if you have any questions or suggestions etc please let me know. This is as much a learning experience for me as it is improving a dope tool.