为了尝试让 App Center 与我的 monorepo React Native 应用程序配合使用,我正在尝试找到一种在自动 git clone
和 npm install
由应用中心调用。
事实上,App Center 会自动 git clone
链接的项目,然后在克隆完成后立即自动运行 npm install
。
没有本机 post-clone
挂钩,我无法制作 自 npm 7 以来似乎无法正常工作。
有谁知道有什么方法可以实现这一目标?
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?
发布评论
评论(1)
我终于自己找到了一个解决方案:App Center 实际上带有内置的钩子,可以完全执行我想做的事情: https://learn.microsoft.com/en-us/appcenter/build/custom/scripts/
只需添加一个
appcenter-post-clone .sh
位于React Native 应用程序的根目录(或者与.xcodeproj
或build.gradle
处于同一级别,并在其中添加任何 bash 脚本。它将在在自动npm install
之前通过 App Center 进行git clone
。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://learn.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 yourbuild.gradle
and add any bash script in there. It will be run right after thegit clone
by App Center and before the automaticnpm install
.