Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions stravaup
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# Command line interface for uploading to Strava.com
#
Expand All @@ -16,7 +16,7 @@ if [ ! -f "${HOME}/.stravauprc" ]; then
echo "and register your own application to get a client id. Then create a file ~/.stravauprc containing"
echo " STRAVAUP_CLIENT_ID = [insert your own]"
echo " STRAVAUP_CLIENT_SECRET = [insert your own]"
exit
exit 1
fi
source "${HOME}/.stravauprc"

Expand Down Expand Up @@ -55,7 +55,7 @@ fi
# Test whether file exists
if [ ! -f "$1" ]; then
echo "$1: no such file exists!"
exit
exit 1
fi

# Get authorization code
Expand All @@ -76,4 +76,7 @@ if [ "$TOKEN" = "" ]; then
fi

# Upload file
curl -X POST https://www.strava.com/api/v3/uploads -H "Authorization: Bearer $TOKEN" -F file=@"$1" -F data_type="$datatype"
curl -X POST https://www.strava.com/api/v3/uploads -H "Authorization: Bearer $TOKEN" -F file=@"$1" -F data_type="$datatype" || exit 1

exit 0