summaryrefslogtreecommitdiff
path: root/bin/postInstall
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-07-14 15:10:31 +0200
committerThomas F. K. Jorna <[email protected]>2021-07-14 15:10:31 +0200
commite5021187e96b78b53203bd95d08d6818aea47d17 (patch)
tree37ec45d00eb963db53cd4bb4f04a770414b351cc /bin/postInstall
New Ignite 7.0.6 app
Diffstat (limited to 'bin/postInstall')
-rwxr-xr-xbin/postInstall40
1 files changed, 40 insertions, 0 deletions
diff --git a/bin/postInstall b/bin/postInstall
new file mode 100755
index 0000000..af540d2
--- /dev/null
+++ b/bin/postInstall
@@ -0,0 +1,40 @@
+#!/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.
+ */
+;[
+ // Patch all the necessary modules.
+ { command: "npx patch-package" },
+
+ // 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)
+ }
+ })