Home > Mobile >  App Center: how to automatically run a script somewhere between git clone and npm install?
App Center: how to automatically run a script somewhere between git clone and npm install?

Time:02-25

In order to try and make App Center work with my monorepo React Native app, I am trying to find a way to insert a few bash scripts between the automated git clone and npm install called by App Center. Indeed, App Center automatically git clone the linked project and then automatically runs npm install as soon as the cloning is done.

There is no native post-clone hook, I haven't been able to make that package work (and I don't even know if it could work since the git clone command would be called from a blank environment) and npm script preinstall doesn't seem to work as it should since npm 7.

Does anyone know of a way to achieve that?

CodePudding user response:

I finally found a solution by myself: App Center actually comes with built-in hooks that allows to do exactly what I wanted to do: https://docs.microsoft.com/en-us/appcenter/build/custom/scripts/

Just add a appcenter-post-clone.sh at the root of your React Native app (or at the same level than your .xcodeproj or your build.gradle and add any bash script in there. It will be run right after the git clone by App Center and before the automatic npm install.

  • Related