Amplify-cli: Moving amplify project directory breaks amplify publish command

Created on 3 May 2019  路  3Comments  路  Source: aws-amplify/amplify-cli

Describe the bug
Moving amplify project directory breaks amplify publish. Throws error:

Cannot find the distribution folder.
Distribution folder is currently set as:
  /full/absolute/path/that/should/be/relative/build

To Reproduce

  1. Create a project, deploy it
  2. Move project directory to another location
  3. Run amplify publish again

Expected behavior
Project deploys without error.

Additional context
The issue is ampllify/.config/local-env-info.json is storing a full path to the amplify project when this should be a relative path or derived from the current working directory or something.

Directories should be portable. Moving my directory shouldn't force me to run amplify init again or edit this file manually.

enhancement platform

All 3 comments

@et304383 after moving the project you should run amplify configure project. This should fix the problem

I get that, but I shouldn't have to. Why can't this information be computed? Why is an absolute path necessary?

@et304383 The amplify command can be used from any sub-dir of the project. So instead of moving up the directory chain and finding out if it's a valid amplify project each time, we store/cache the absolute path of the project so the CLI does not have to do this search on each and every command. We'll look into it as a team and decide the path forward. Thanks for bringing this to our attention.

Was this page helpful?
0 / 5 - 0 ratings