-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(process): add cli parameters for importing directly to sphere #40
Conversation
Integration tests don't work because of missing sphere.io credentials in travis env variables. |
1 similar comment
config = | ||
sphereClientConfig: options | ||
|
||
Promise.resolve config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for Promise.resolve
. You can just return config here since you are already in the then
callback.
Also in line 49
@junajan can you fix the breaking test also? Would be awesome 😊 |
1 similar comment
@@ -1,28 +1,32 @@ | |||
language: node_js | |||
node_js: | |||
- '0.10' | |||
- '0.12' | |||
- '0.10' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can get rid of this. And we should test on 4
as well
sphereClient.productTypes.byId(productType.id) | ||
.delete(productType.version) | ||
.then -> | ||
done() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: you can keep the chain as a flat structure
importer.init(argv)
.then -> sphereClient.productTypes.fetch()
.then (res) ->
console.log "Deleting old product types", res.body.results.length
Promise.map res.body.results, (productType) ->
sphereClient.productTypes.byId(productType.id)
.delete(productType.version)
.then done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated here 48a32c2
importer = null | ||
sphereClient = null | ||
|
||
before -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're doing async stuff here, you have to use the done
callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched tests to mocha which is working with Promises too - so it uses promise instead of done callback
silent: !! argv.logSilent | ||
streams: [ | ||
{ level: 'error', stream: process.stderr } | ||
{ level: argv.logLevel || 'info', path: "#{argv.logDir || '.'}/#{package_json.name}.log" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be better to use path.join
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added here 09fdc1b
OK LGTM now 👍 |
No description provided.