Skip to content

Commit 21480ed

Browse files
author
Josh Hebb
authored
Merge pull request #3 from joshhebb/development
Updated the content & model export process to be self contained in JSON file
2 parents adaf565 + f623864 commit 21480ed

File tree

3 files changed

+4389
-12
lines changed

3 files changed

+4389
-12
lines changed

bin/contentful-export-import.js

+6-11
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44
*/
55

66
var prompt = require('prompt');
7-
var spaceExport = require('contentful-export');
87
var spaceImport = require('contentful-import');
98
var updateJson = require('update-json');
109

1110
// Contentful Export & Import Options
1211
var options = {
13-
spaceId: 'hpty8kufn7nl',
12+
spaceId: '',
1413
accessToken: '',
15-
managementToken: 'CFPAT-faf804d0d0abc11ef6c5844ef15ffbf8f467a3236ccccd5a3b7af618f0fc3ad2',
14+
managementToken: '',
1615
saveFile: false,
1716
maxAllowedItems: 100
1817
}
@@ -58,11 +57,11 @@ console.log("---------------------------------------------------------");
5857

5958
// Get two properties from the user: username and email
6059
prompt.get(schema, function (err, result) {
61-
spaceExport(options)
62-
.then((output) => {
60+
61+
var contentfulSpaceExport = require('./contentful-export.json');
6362

6463
// Update the options with the output JSON from the export and the user input spaceId & management token.
65-
options.content = output;
64+
options.content = contentfulSpaceExport;
6665
options.spaceId = result.spaceId;
6766
options.accessToken = result.accessToken;
6867
options.managementToken = result.managementToken;
@@ -86,9 +85,5 @@ prompt.get(schema, function (err, result) {
8685
})
8786
.catch((err) => {
8887
console.log('Something went wrong with the import: ', err)
89-
})
90-
})
91-
.catch((err) => {
92-
console.log('Uh oh! Something went wrong: ', err)
93-
})
88+
});
9489
});

0 commit comments

Comments
 (0)