ruby - Fastlane can not run git actions in a certain project folder
问题描述
--MainProject
-/fastlane/Fastlane
|
--SwiftPackageManager
|
--KotlinMultiPlatfrom
I have the following projects checked out on my computer.One of the fastlane scripts needs to change directory to KotlinMultiPlatfrom project get the latest tag compare that one with the latest tag in SwiftPackageManager project and create a new XCFrmework if there is a newer version which is not created yet.
The lane looks like following in -/fastlane/Fastlane of MainProject.
lane :generate_KMM_xcframework do
Dir.chdir("../../KotlinMultiPlatfrom") do
lastTag = last_git_tag(pattern: "xxx*")
...
end
Dir.chdir("../../SwiftPackageManager") do
lastTag = last_git_tag(pattern: "xxx*")
...
git_commit(path:"./*", message: "SPM version update: #{lastTagTrimmed}")
add_git_tag(tag: "#{lastTagTrimmed}")
push_to_git_remote
end
...
end
The problem is last_git_tag
is executed successfully inside KotlinMultiPlatfrom, although the SwiftPackageManager is a valid git repository last_git_tag
complains fatal: Not a git repository (or any of the parent directories): .git
.
If I call sh git fetch && git tag
inside all works fine regarding git and puts Dir.pwd
also prints me the correct path.
My question is what can be the difference between both of them accessing the fastlane actions related with git (last_git_tag, git_commit, add_git_tag,push_to_git_remoteaction)
解决方案
推荐阅读
- github - GitHub 页面自动化
- javascript - 如何在for循环中使用变量
- vba - Outlook 365 宏启用/禁用/运行所有规则
- javascript - 我可以使用 .split 方法在 javascript 中将字符串拆分为多个十六进制字符吗?
- spring-mvc - Spring Security with JWT:不调用验证令牌的 JWT 过滤器
- memory-management - 强制 malloc 预故障/MAP_POPULATE/MADV_WILLNEED 整个程序/进程的所有分配
- c++ - How I can stop the " while loop " if the user enter number <0?
- bash - 在同一行中查找两个字符串,然后使用 sed 替换
- kubernetes - Windows 10 Enterprise 和 Hyper-V 中的 Minikube
- java - 如何使用 log4j 为 PubNub 禁用 okhttp3.internal.platform.Platform.log?