如何在curl命令中删除名为${env.DateString}的工件目录
我正在尝试删除一个名为 $ {env.datestring} 但无法正确插入的文物目录。我通过使用\ $ {env.datestring}逃脱了,但是括号{}被排除在某种程度上。 目录路径http:// localhost:8080/artifactory/myrepo/docker/$ {env.datestring}/
curl -H "X-JFrog-Art-Api:<API-KEY>" -X DELETE http://localhost:8080/artifactory/myrepo/Docker/\${env.DateString}/
error:
{
"errors" : [ {
"status" : 404,
"message" : "Could not locate artifact 'myrepo:Docker/$env.DateString' (Nothing to delete)."
} ]
}[
插入插值时错过了$ {env.dateString}中的括号
I am trying to delete an artifactory directory named ${env.DateString} But unable to interpolate properly. I escaped by using \ ${env.DateString} but somehow the brackets {} are being left out.
Directory path http://localhost:8080/artifactory/myrepo/Docker/${env.DateString}/
curl -H "X-JFrog-Art-Api:<API-KEY>" -X DELETE http://localhost:8080/artifactory/myrepo/Docker/\${env.DateString}/
Error:
{
"errors" : [ {
"status" : 404,
"message" : "Could not locate artifact 'myrepo:Docker/$env.DateString' (Nothing to delete)."
} ]
}[
Somehow the brackets in ${env.DateString} is missed when interpolating
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
$和。需要编码URL。我们可以使用以下API删除文件夹
curl -h“ x-jfrog-art-api:-x删除http:// localhost:8080/artifactory/myrepo/docker/docker/%24%7BENV.DATESTESTRING%7D/
the $ and. needs to be URL encoded. We can use the below API to delete the folder
curl -H "X-JFrog-Art-Api: -X DELETE http://localhost:8080/artifactory/myrepo/Docker/%24%7Benv.DateString%7D/