Amplify-cli: `amplify publish` doesn't error out if no files were published.

Created on 5 Oct 2018  Â·  6Comments  Â·  Source: aws-amplify/amplify-cli

Describe the bug
If the DistributionDir doesn't point to a valid folder the publish step logs out exactly the same messages as if it did point to a valid folder.

The only difference is that ✔ Uploading files successful. happens much faster.

To Reproduce
Steps to reproduce the behavior:

  1. Go to .amplify/config/project-config.json
  2. Change DistributionDir to a broken path
  3. run amplify publish
  4. Notice that there is no error.

Expected behavior
Amplify publish should warn or error out if you have tried to publish nothing.

Screenshots
image

feature-request hosting

Most helpful comment

@allanhortle We took your concern and submitted a PR for it out here - https://github.com/aws-amplify/amplify-cli/pull/694
I’ll update this thread when the PR is merged.

All 6 comments

I’m having the same issue. My files aren’t being deployed to S3 and I’m not getting an error so I cannot debug.

same issue. i had everything setup and working on my pc. i then proceeded to set it up on my laptop, pulling in the project from git but now amplify push seems to indicate everything went well (files are built correctly and in the dist folder) but nothing is being added to the s3 bucket. the setup on my laptop is using different api keys but same user account with same access to the services.

I will mark this as a feature request to make the hosting feature more intelligent. Currently it carries out the build command and then uploads the files in the specified distribution folder to the hosting bucket, and if the distribution folder is empty, nothing will be uploaded.

Fair enough if you don't have the time to focus on this but its pretty developer unfriendly.
The cli lists the built files and then implies they were uploaded successfully. Could you not make a half fix and change the message to n files uploaded successfully? That way it would at least read 0 files uploaded successfully

@allanhortle We took your concern and submitted a PR for it out here - https://github.com/aws-amplify/amplify-cli/pull/694
I’ll update this thread when the PR is merged.

694 was merged.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mwarger picture mwarger  Â·  3Comments

ffxsam picture ffxsam  Â·  3Comments

adriatikgashi picture adriatikgashi  Â·  3Comments

jeanpaulcozzatti picture jeanpaulcozzatti  Â·  3Comments

onlybakam picture onlybakam  Â·  3Comments