Skip to content

Commit

Permalink
fix(migration): Pass access token correctly to migration lib (#142)
Browse files Browse the repository at this point in the history
Before, the migration CLI would not pick up the access token passed from
`contentful-cli`, instead it would use its own mechanism to resolve
`~/.contentfulrc.json`. This was caused by the migration CLI using a
different property name for the access token [1].

[1]: https://github.com/contentful/contentful-migration/blob/master/src/bin/lib/config.ts#L9
  • Loading branch information
Thomas Scholtes authored and phoebeschmidt committed Jun 4, 2019
1 parent 719bcb1 commit 9f1e194
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cmds/space_cmds/migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const migration = async (argv) => {
const managementApplication = `contentful.cli/${version}`
const managementFeature = `space-migration`

const options = { ...argv, spaceId, managementApplication, managementFeature, managementToken }
const options = { ...argv, spaceId, managementApplication, managementFeature, accessToken: managementToken }
if (proxy) {
// contentful-import and contentful-export
// expect a string for the proxy config
Expand Down
2 changes: 1 addition & 1 deletion test/unit/cmds/space_cmds/migration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ getContext.mockResolvedValue({ cmaToken: 'managementToken' })

test('it should pass all args to the migration', async () => {
const stubArgv = {
managementToken: 'managementToken',
accessToken: 'managementToken',
managementApplication: `contentful.cli/${version}`,
spaceId: 'spaceId',
managementFeature: 'space-migration'
Expand Down

0 comments on commit 9f1e194

Please sign in to comment.