Skip to content
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion Support/assets/upload.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,18 @@
$response = send_asset($api_key, $password, $store ,$xmlFile);

if('200' == response_code($response)) {
echo "Uploaded {$assetKey} to {$config->current}.";

/* Add by Dale Tournemille 2013. This invokes terminal-notifier (by Eloy Durán) and displays the success upload message using OS X Notification Center. */
echo "Uploaded {$assetKey} to {$config->current}.";
echo exec("/usr/local/bin/terminal-notifier -title 'File Uploaded' -message 'The file {$assetKey} has been uploaded to your {$config->current} theme on Shopify.' -sender com.macromates.TextMate.preview");


} else {
// Not ideal, but it works. Problem (though not much of one ):
// response on a fail will return the full curl page: ie, shopify 404 full html, + error code at the bottom
// Will robustify if it becomes an issue.
echo "*Error: Could not upload {$assetKey} to {$config->current}." ;
echo exec("/usr/local/bin/terminal-notifier -title 'Upload Error' -message 'Houston, we have a problem. The file {$assetKey} was NOT uploaded to {$config->current}.' -sender com.macromates.TextMate.preview");
output_error($response);
}
//And clean up
Expand Down
2 changes: 2 additions & 0 deletions Support/assets/upload_multi.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@

if('200' == response_code($response)) {
echo "Uploaded: {$assetKey}<br>";
echo exec("/usr/local/bin/terminal-notifier -title 'File Uploaded' -message 'The file {$assetKey} has been uploaded to Shopify.' -sender com.macromates.TextMate.preview");
} else {
// Not ideal, but it works. Problem (though not much of one ):
// response on a fail will return the full curl page: ie, shopify 404 full html, + error code at the bottom
// Will robustify if it becomes an issue.
echo "*Error: Could not upload {$assetKey} to {$config->current}." ;
echo exec("/usr/local/bin/terminal-notifier -title 'Upload Error' -message 'Houston, we have a problem. The file {$assetKey} was NOT uploaded to {$config->current}.' -sender com.macromates.TextMate.preview");
output_error($response, array('line_break' => '<br>'));
}
//And clean up
Expand Down