Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
Add a better error message when uploading with a zip
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Gardner committed Mar 13, 2019
1 parent b688200 commit aebf3b8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/commands/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ const utils = require('../utils');

const upload = context => {
context.line('Preparing to upload a new version.\n');
return utils.upload().then(() => {
context.line(
`\nUpload of ${constants.BUILD_PATH} and ${
constants.SOURCE_PATH
} complete! Try \`zapier versions\` now!`
);
});
return utils
.upload()
.then(() => {
context.line(
`\nUpload of ${constants.BUILD_PATH} and ${
constants.SOURCE_PATH
} complete! Try \`zapier versions\` now!`
);
})
.catch(error => Promise.reject(error));
};
upload.argsSpec = [];
upload.argOptsSpec = {};
Expand Down
7 changes: 7 additions & 0 deletions src/utils/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@ const upload = (zipPath, sourceZipPath, appDir) => {

const fullZipPath = path.resolve(appDir, zipPath);
const fullSourceZipPath = path.resolve(appDir, sourceZipPath);
const isMissingZip = !fs.existsSync(fullZipPath);

if (isMissingZip) {
return Promise.reject(
new Error('Missing a built app. Trying running `zapier push`.')
);
}

return getLinkedApp(appDir)
.then(app => {
Expand Down

0 comments on commit aebf3b8

Please sign in to comment.