mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Added flag.io plugin
usage: upload <file> [<file> ...]
This commit is contained in:
parent
397c085a19
commit
eb76f3582f
1 changed files with 15 additions and 0 deletions
15
plugins/flagio/flagio.plugin.zsh
Normal file
15
plugins/flagio/flagio.plugin.zsh
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
# Upload files to flag.io
|
||||||
|
upload() {
|
||||||
|
if [ $# -lt 1 ]; then
|
||||||
|
printf 'usage: upload <file> [<file> ...]\n'
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for path in $@; do
|
||||||
|
if [ -f "$path" ]; then
|
||||||
|
curl -sT "$path" flag.io | egrep -v '^#'
|
||||||
|
else
|
||||||
|
printf 'File not found: %s\n' "$path"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue