This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(windows): Move postInstall commands to their own script; add comm…
…and to kill metro (#247 by @bryanstearns)
- Loading branch information
1 parent
2de73cd
commit d5e878d
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env node | ||
|
||
const childProcess = require("child_process") | ||
const os = require("os") | ||
|
||
/** | ||
* Do all things that need to be done after installing packages | ||
* | ||
* Yes, it slows down package installation a little, but it's nice to not | ||
* have to remember these extra steps. | ||
*/ | ||
;[ | ||
// Make sure we're set up correctly | ||
{ command: "solidarity" }, | ||
|
||
// Kill the metro bundler if it's running. | ||
{ command: 'pkill -f "cli.js start" || set exit 0', onlyPlatforms: ["darwin", "linux"] }, | ||
// Help wanted: Add the windows version here. { command: "????", onlyPlatforms: ["win32"] }, | ||
|
||
// Make sure our native modules are androidX-happy | ||
{ command: "jetify" }, | ||
|
||
// on iOS, make sure our native modules are installed | ||
{ command: "pod install", cwd: "ios", onlyPlatforms: ["darwin"] }, | ||
] | ||
.filter(({ onlyPlatforms }) => !onlyPlatforms || onlyPlatforms.includes(os.platform())) | ||
.forEach(commandAndOptions => { | ||
const { command, onlyPlatform: _, ...options } = commandAndOptions | ||
try { | ||
childProcess.execSync(command, { | ||
stdio: "inherit", | ||
...options, | ||
}) | ||
} catch (error) { | ||
process.exit(error.status) | ||
} | ||
}) |