Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/make request url #1271

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "contentful-migration",
"version": "0.0.0-development",
"version": "0.0.0",
"description": "Migration tooling for contentful",
"author": "Contentful GmbH",
"license": "MIT",
Expand Down Expand Up @@ -40,7 +40,10 @@
"test:unit:debug": "NODE_ENV=test mocha debug --require test/setup-unit.js --recursive 'test/unit/**/**/*.spec.{js,ts}'",
"test:integration:debug": "NODE_ENV=test mocha debug --require test/integration/setup.js 'test/integration/**/*.spec.js'",
"test:e2e:debug": "NODE_ENV=test mocha debug 'test/end-to-end/**/*.spec.js'",
"cm": "git-cz"
"cm": "git-cz",
"unpublish-library": "npm unpublish @ks/contentful-migration --force",
"update-version": "npm version patch --force",
"publish-library": "npm run build && npm run update-version && npm run unpublish-library && npm publish"
},
"files": [
"README.md",
Expand Down
9 changes: 8 additions & 1 deletion src/bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ export const createMakeRequest = (
})

const makeBaseUrl = (url: string) => {
const parts = ['spaces', spaceId, 'environments', environmentId, trim(url, '/')]
const parts = [
'https://api.contentful.com',
'spaces',
spaceId,
'environments',
environmentId,
trim(url, '/')
]

return parts.filter((x) => x !== '').join('/')
}
Expand Down