如何检查詹金斯管道中的目录是否存在?
我有一个小型管道阶段,它使用脚本SH
检查目录是否存在
stage("Check if Module exists") {
steps {
script {
sh "ls -la && pwd"
sh "[ -d '"${env.SOURCE_REPO}"/"${env.COMPONENT_NAME}"' ]"
repo_Check()
}
}
}
IM使用2个ENV变量来创建目录的完整路径。此语句的正确语法是什么?
I have this small pipeline stage that uses the script sh
to check to see if a directory exists
stage("Check if Module exists") {
steps {
script {
sh "ls -la && pwd"
sh "[ -d '"${env.SOURCE_REPO}"/"${env.COMPONENT_NAME}"' ]"
repo_Check()
}
}
}
Im using 2 env variables to create the full path of a directory. What is the correct syntax for this statement?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论