【发布时间】:2019-05-01 13:11:33
【问题描述】:
我有一个带有子模块的 git 存储库,我想在自动部署的管道上部署到 heroku,但是当 ng build --prod 进程接近完成时,我收到错误
ERROR in : Couldn't resolve resource ./repo/style.css relative to /tmp/build_d3089108a84fd9e7fb117fed84b787b6/src/app/resume/resume.component.ts
因为我的子模块(存在于/src/app/resume/repo)在文件resume.component.ts 中被引用:
@Component({
selector: 'app-resume',
templateUrl: './repo/resume.html',
styleUrls: ['./repo/style.css']
})
虽然 github 存储库指向子模块的特定提交,但初始 git clone 不会克隆它旁边的子模块。
我的.gitmodules文件如下:
[submodule "Resume"]
path = src/app/resume/repo
url = https://github.com/<my username>/Resume.git
问题:
有没有办法强制 heroku-git 在完整 repo 的同时克隆子模块?
我可以运行一个脚本,让 heroku 在克隆完整 repo 之后但在构建之前自行克隆子模块吗?
【问题讨论】:
-
它should just work。你确定你有一个正确的
.gitmodules文件吗? (子模块不仅仅是嵌套的存储库;containing repo should have a.gitmodulesfile。) -
我设置了一个 .gitmodules 文件,我会将它添加到帖子中。并且回购是公开的
-
文件名大小写是否存在差异,例如
resume与Resume?这适用于 Windows 和 macOS,但不适用于 Heroku。 -
repo 名称的第一个字母大写,其他都是小写。
-
尝试
clone使用递归子模块或递归选项(我忘记了)
标签: git heroku git-submodules