mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 14:13:26 +00:00
Example Zsh/Bash function for transfer.sh homepage #115
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @keks24 on GitHub.
Hello,
I just want to share this. If you consider my function as an worthy example for the homepage, go for it!:
Example outputs:
-Ramon
@keks24 commented on GitHub:
I just tested this on my end and it works for
zshandbash.What output do you get, if you upload a small file via
curllike the following?:curlreturns me this:Maybe the key
x-url-deleteis written differently and not matched bygawk.These are the package versions I am using and an upload test, which I did in
bash:I refactored the function to intercept errors, but the origin function above works as well for
zshandbash:~/.bashrc@paolafrancesca commented on GitHub:
not sure about that
transfer:9: command not found: #@keks24 commented on GitHub:
I found the issue!
It seems, that
x-url-deleteis written differently in some versions ofcurlas seen in the README.md file.Since there are different versions of
awklikegawk,mawkand so on, I am going to matchx-url-deletewithout case sensitivity; using the variableIGNORECASEonly works forgawkand is not sufficient.This function should work now:
@gingerbeardman commented on GitHub:
Yeah, delete command is not shown when using zsh
@paolafrancesca commented on GitHub:
nice @keks24 , thanks for sharing
I will add to
README.mdfor the moment, since the frontend is already cluttered with examples unluckily :(if you are able to write a cross-shell (bash/zsh at least) version of your function, including echoing delete command (that's really great!) we could promote it to frontend.
please let me know what do you think
@keks24 commented on GitHub:
I could not help myself, but to improve the function once again. It is slowly growing, where I almost got to the point to create a separate repository for it, but I will keep it like this for now.
I consider this the final version now.
It can now upload multiple files, shows the size of each file in
Kibibyteand prompts before uploading:62ed27df71...4c0006f644@paolafrancesca commented on GitHub:
@keks24 thank you very much for you effort!
I will try to add this to the frontend in the weekend
@keks24 commented on GitHub:
I think, that has something to do with
--progress-bar, which is not perfectly removed bysed.Does this one with
--silentand--show-errorwithoutsedwork for you?:Leaving out the parameter
--silentmesses up the output for some reason:@keks24 commented on GitHub:
This one should be the final, functioning version for
zshandbash, which also filters out thedeletion token:c4ee6d3bb5...fe45e0e30c@keks24 commented on GitHub:
My pleasure! 😃
If it is too big for the
README.md, you may want to put it into an expandabledetail section:Some details
@keks24 commented on GitHub:
@aspacca
I already did that in #478, which also got merged by @stefanbenten. :)
@paolafrancesca commented on GitHub:
lol, thanks :)
@paolafrancesca commented on GitHub:
@keks24 , thank you very much
if you have time and you can open a PR to directly update the
README.mdit would be awesomeI'm a little busy this days and I'm not sure when I'll be able to do on my own 🙏