Skip to content
Merged
Changes from 2 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: 8 additions & 3 deletions upload_sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,14 @@ if [ -n "$newapks" ]; then
case "$REPLY" in
y*|Y*)
for apk in $newapks; do
echo "Uploading $apk to APKmirror.com..."
filename="$(basename "$apk")"
curl -s -S -X POST -F "fullname=$name (OpenGApps.org)" -F "email=$email" -F "changes=" -F "file=@$apk;filename=$filename" "http://www.apkmirror.com/wp-content/plugins/UploadManager/inc/upload.php" > /dev/null
upload=$(curl -s -S "http://www.apkmirror.com/wp-json/apkm/v1/apk_uploadable/$(md5sum "$apk"|cut -f1 -d' ')" | grep uploadable)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use spaces for the cut parameters:
cut -f 1 -d ' '
(to be fully compliant with some older/stricter versions of it)
it is also often more readable to keep space around the pipe

also best to pass the -q to grep, to keep it silent if matching, or not; and " around the keyword

if [ -z "$upload" ]; then
echo "Skipping $apk, already exists on APKmirror.com..."
else
echo "Uploading $apk to APKmirror.com..."
filename="$(basename "$apk")"
curl -s -S -X POST -F "fullname=$name (OpenGApps.org)" -F "email=$email" -F "changes=" -F "file=@$apk;filename=$filename" "http://www.apkmirror.com/wp-content/plugins/UploadManager/inc/upload.php" > /dev/null
fi
done
;;
*) echo "Did NOT submit to APKmirror.com";;
Expand Down