cli client: update and move to contrib
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
@@ -25,7 +25,7 @@ RUN cargo clean
|
||||
###### Runner Image
|
||||
FROM scratch as runner
|
||||
COPY --from=builder /app/empty_upload upload
|
||||
COPY ./client upload/client
|
||||
COPY ./contrib/cli/client upload/client
|
||||
COPY ./templates templates
|
||||
COPY ./static static
|
||||
COPY ./themes themes
|
||||
|
||||
10
client
10
client
@@ -1,10 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
url="http://127.0.0.1:8000"
|
||||
filepath="$1"
|
||||
filename=$(basename -- "$filepath")
|
||||
extension="${filename##*.}"
|
||||
|
||||
response=$(curl --data-binary @${filepath:-/dev/stdin} --url $url)
|
||||
echo "$url$response"".""$extension" | tee >(xclip -selection clipboard)
|
||||
|
||||
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"
|
||||
Reference in New Issue
Block a user