From d66feaa4d7464faad3eaf756a21a592d494916e0 Mon Sep 17 00:00:00 2001 From: Niklas Date: Wed, 24 Mar 2021 23:17:20 +0100 Subject: [PATCH] fixed path bug in nc script --- .local/share/scripts/nc-share-text.sh | 4 +--- .local/share/scripts/nc-share.sh | 12 +++++------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.local/share/scripts/nc-share-text.sh b/.local/share/scripts/nc-share-text.sh index c35ad6e..88485d6 100755 --- a/.local/share/scripts/nc-share-text.sh +++ b/.local/share/scripts/nc-share-text.sh @@ -16,9 +16,7 @@ else exit 1 fi -FILENAME=$(basename $FILE_PATH) - -$SCRIPTPATH/nc-share-file.sh "$FILENAME" \ +$SCRIPTPATH/nc-share-file.sh "$FILE_PATH" \ | perl -n -e '/([a-zA-Z0-9]+)$/ && print $1' \ | awk -n -e '{print "https://pb.kapelle.org/"$1}' diff --git a/.local/share/scripts/nc-share.sh b/.local/share/scripts/nc-share.sh index b907cef..9b417f9 100755 --- a/.local/share/scripts/nc-share.sh +++ b/.local/share/scripts/nc-share.sh @@ -14,13 +14,11 @@ else exit 1 fi -FILENAME=$(basename $FILE_PATH) - -if file -i -b "$FILENAME" | grep "text" &> /dev/null; then - $SCRIPTPATH/nc-share-text.sh "$FILENAME" -elif file -i -b "$FILENAME" | grep "image" &> /dev/null; then - $SCRIPTPATH/nc-share-file.sh "$FILENAME" | awk '{print $1"/preview"}' +if file -i -b "$FILE_PATH" | grep "text" &> /dev/null; then + $SCRIPTPATH/nc-share-text.sh "$FILE_PATH" +elif file -i -b "$FILE_PATH" | grep "image" &> /dev/null; then + $SCRIPTPATH/nc-share-file.sh "$FILE_PATH" | awk '{print $1"/preview"}' else - $SCRIPTPATH/nc-share-file.sh "$FILENAME" + $SCRIPTPATH/nc-share-file.sh "$FILE_PATH" fi