cli client: update and move to contrib
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
parent
e17a5f7cdb
commit
e91393f63c
3 changed files with 16 additions and 11 deletions
15
contrib/cli/client
Executable file
15
contrib/cli/client
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Change the url accordingly
|
||||
URL="https://bin.wantguns.dev"
|
||||
|
||||
FILEPATH="$1"
|
||||
FILENAME=$(basename -- "$FILEPATH")
|
||||
EXTENSION="${FILENAME##*.}"
|
||||
|
||||
RESPONSE=$(curl --data-binary @${FILEPATH:-/dev/stdin} --url $URL)
|
||||
PASTELINK="$URL$RESPONSE"
|
||||
|
||||
[ -z "$EXTENSION" ] && \
|
||||
echo "$PASTELINK" || \
|
||||
echo "$PASTELINK.$EXTENSION"
|
||||
Loading…
Add table
Add a link
Reference in a new issue