mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-23 12:40:19 +01:00
Alias for fish-shell
This commit is contained in:
parent
7986596d2b
commit
af9d09bb00
1 changed files with 16 additions and 0 deletions
16
README.md
16
README.md
|
@ -33,6 +33,22 @@ transfer() {
|
|||
|
||||
alias transfer=transfer
|
||||
===
|
||||
|
||||
Add alias for fish shell, add function file to ~/.config/fish/functions/transfer.fish
|
||||
===
|
||||
function transfer --description 'Upload a file to transfer.sh'
|
||||
if [ $argv[1] ]
|
||||
# write to output to tmpfile because of progress bar
|
||||
set -l tmpfile ( mktemp -t transferXXX )
|
||||
curl --progress-bar --upload-file $argv[1] https://transfer.sh/(basename $argv[1]) >> $tmpfile
|
||||
cat $tmpfile
|
||||
command rm -f $tmpfile
|
||||
else
|
||||
echo 'usage: transfer FILE_TO_TRANSFER'
|
||||
end
|
||||
end
|
||||
===
|
||||
|
||||
$ transfer test.txt
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in a new issue