App Center:如何在 git clone 和 npm install 之间自动运行脚本?

发布于 2025-01-09 09:35:07 字数 536 浏览 1 评论 0 原文

为了尝试让 App Center 与我的 monorepo React Native 应用程序配合使用,我正在尝试找到一种在自动 git clonenpm 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡忘如思 2025-01-16 09:35:07

我终于自己找到了一个解决方案:App Center 实际上带有内置的钩子,可以完全执行我想做的事情: https://learn.microsoft.com/en-us/appcenter/build/custom/scripts/

只需添加一个 appcenter-post-clone .sh 位于React Native 应用程序的根目录(或者与 .xcodeprojbuild.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 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文