-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·34 lines (31 loc) · 968 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env node
import uploader from './uploader/prompt.js'
import base from './src/base/prompt.js'
import datasources from './uploader/schemas/datasources/prompt.js'
import components from './src/components/prompt.js'
import dependencies from './src/dependencies.js'
import environment from './src/environment.js'
const __dirname = process.argv[2] === '--test' ? process.cwd() + '/testing' : process.cwd()
uploader.createPrompt()
.then(({ storyblokApi, STORYBLOK_TOKEN }) => {
return environment(__dirname).inject(STORYBLOK_TOKEN)
.then(() => {
return storyblokApi
})
})
.then((storyblokApi) => {
return base.createPrompt(__dirname)
.then(() => {
return storyblokApi
})
})
.then((storyblokApi) => {
return datasources.createPrompt(storyblokApi)
.then(() => {
return storyblokApi
})
}).then((storyblokApi) => {
return components.createPrompt(storyblokApi, __dirname)
}).then(() => {
dependencies(__dirname).inject()
})