aws-amplify / aws-amplify/amplify-cli

amplify pull - dest already exists

Open
#3,969 2 comments 2 reactions 0 assignees View on GitHub
feature-request p3 platform-pull
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

**Describe the bug**

`amplify pull` then Ctrl-C'ing out of the process leaves both `amplify` and `amplify-backup` folders, so `amplify pull` a second time returns:

```console
❯ amplify pull
dest already exists.
Error: dest already exists.
at doRename (/Users/ecclemm/.nvm/versions/node/v10.16.3/lib/node_modules/@aws-amplify/cli/node_modules/fs-extra/lib/move-sync/move-sync.js:25:34)
at Object.moveSync (/Users/ecclemm/.nvm/versions/node/v10.16.3/lib/node_modules/@aws-amplify/cli/node_modules/fs-extra/lib/move-sync/move-sync.js:17:10)
at backupAmplifyFolder (/Users/ecclemm/.nvm/versions/node/v10.16.3/lib/node_modules/@aws-amplify/cli/lib/attach-backend.js:66:12)
at attachBackend (/Users/ecclemm/.nvm/versions/node/v10.16.3/lib/node_modules/@aws-amplify/cli/lib/attach-backend.js:13:5)
at Object.run (/Users/ecclemm/.nvm/versions/node/v10.16.3/lib/node_modules/@aws-amplify/cli/lib/commands/pull.js:44:19)
at Object.executeAmplifyCommand (/Users/ecclemm/.nvm/versions/node/v10.16.3/lib/node_modules/@aws-amplify/cli/lib/index.js:94:25)
at executePluginModuleCommand (/Users/ecclemm/.nvm/versions/node/v10.16.3/lib/node_modules/@aws-amplify/cli/lib/execution-manager.js:47:32)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
```

**Amplify CLI Version**

`4.13.3`

**To Reproduce**

1. `amplify pull`
1. Ctrl-C during the project selection screen.
1. `amplify pull`

**Expected behavior**

Cleanup on `SIGINT`.

**Desktop (please complete the following information):**
- OS: Mac
- Node Version. `v10.16.3`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.