Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
76c10294
Commit
76c10294
authored
Nov 23, 2016
by
Ilyes Kechidi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a transfer.sh plugin
created a function to easily upload files to transfer.sh file sharing site Usage : transfer file.txt
parent
0b340bc3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
transfer.plugin.zsh
plugins/transfer/transfer.plugin.zsh
+8
-0
No files found.
plugins/transfer/transfer.plugin.zsh
0 → 100644
View file @
76c10294
# transfer.sh Easy file sharing from the command line
# transfer Plugin
# Usage Example :
# > transfer file.txt
transfer
()
{
if
[
$#
-eq
0
]
;
then
echo
"No arguments specified. Usage:
\n
echo transfer /tmp/test.md
\n
cat /tmp/test.md | transfer test.md"
;
return
1
;
fi
tmpfile
=
$(
mktemp
-t
transferXXX
)
;
if
tty
-s
;
then
basefile
=
$(
basename
"
$1
"
|
sed
-e
's/[^a-zA-Z0-9._-]/-/g'
)
;
curl
--progress-bar
--upload-file
"
$1
"
"https://transfer.sh/
$basefile
"
>>
$tmpfile
;
else
curl
--progress-bar
--upload-file
"-"
"https://transfer.sh/
$1
"
>>
$tmpfile
;
fi
;
cat
$tmpfile
;
rm
-f
$tmpfile
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment