-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[RNPM] Add pre/postunlink #9157
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
Changes from 2 commits
024d623
3a14bf8
c99ff55
c1c2fd3
6341dc8
73c1d70
d4f581a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| module.exports = { | ||
| func: require('./src/link'), | ||
| description: 'links all native dependencies', | ||
| name: 'link [packageName]', | ||
| name: 'link <packageName>', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the packageName argument should remain optional shouldn't it?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for link - yes, for unlink it's mandatory
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| module.exports = (cb) => cb(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module.exports = (func) => new Promise((resolve, reject) => | ||
| func((err, res) => err ? reject(err) : resolve(res)) | ||
| ); |
Uh oh!
There was an error while loading. Please reload this page.
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.
This is needed because the rnpm commands have additional positional arguments, e.g
link <packageName>in their names, therefore a naive full string comparison wouldn't work.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.
Looks like this might be breaking all usages of
link ABCDwith the RC? If yes, that has to be cherry-picked into stable release.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.
Yep. Any chance you could take this whole change?
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.
Yeah, actually @rozele submitted a PR fixing that particular thing, mind rebasing in like an hour once the merge finishes?
Uh oh!
There was an error while loading. Please reload this page.
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.
Which PR? I don't think #9173 is related, it only fixes showing the help. When you run the command
react-native link react-native-plugin, you would still see the warning becauseisValidCommandfails to find a command with a name that matches. This fixes that.I noticed you added "needs-revision", what exactly needs revision? Also, given that this is not the main point of this PR, I would appreciate it if you could comment on the addition of the pre/post unlink hooks :).
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.
Yeah, but we have already merged a fix for that here: https://github.com/facebook/react-native/blob/master/local-cli/cliEntry.js#L161