Skip to content

Commit 98161ca

Browse files
committed
Do path validation after construct_auth()
Because the path validation calls the API and this will fail when the authentication has not been set up.
1 parent bd0302e commit 98161ca

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ada/ada

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,10 +2225,6 @@ validate_input() {
22252225
echo 1>&2 "ERROR: command $command requires a directory."
22262226
exit 1
22272227
fi
2228-
if ! is_dir "$path" ; then
2229-
echo 1>&2 "ERROR: '$path' is not a directory."
2230-
exit 1
2231-
fi
22322228
;;
22332229
longlist | checksum | stage | unstage )
22342230
if [[ -z $pathlist || $pathlist =~ ^-- ]] ; then
@@ -2750,6 +2746,13 @@ api_call () {
27502746
esac
27512747
exit 1
27522748
fi
2749+
# Some additional input validation, after construct_auth().
2750+
# We need an existing directory.
2751+
if ! is_dir "$path" ; then
2752+
echo 1>&2 "ERROR: '$path' is not a directory."
2753+
exit 1
2754+
fi
2755+
# Setting up channel
27532756
channel_url=$(get_channel_by_name "$channel_name")
27542757
channel_id=$(basename "$channel_url")
27552758
if [ "$channel_url" = "" ] ; then

0 commit comments

Comments
 (0)