Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feat: Upload multiple files, upload directory #1

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

Merged
merged 2 commits into from
Jan 5, 2024

Conversation

criticalsession
Copy link
Contributor

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

  1. Added a -dir flag that accepts a directory then uploads all files inside the directory (non-recursive... maybe later haha)
  2. Using the same update, it was easy now to read multiple args instead of a single one and plug it into the directory upload code

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.

@overflowy
Copy link
Owner

Hey, first I wanted to thank you for this pull request.

Currently I am off for holidays, but I'll be free to review the changes next week.

Wish you a Happy New Year!

@overflowy overflowy merged commit 1c6502e into overflowy:main Jan 5, 2024
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.

2 participants