git bash脚本aws cloudfront失效路径不正确

eulz3vhy  于 5个月前  发布在  Git
关注(0)|答案(1)|浏览(70)

我是bash的新手,尝试通过简单地调用

aws cloudfront create-invalidation --distribution-id XXX --profile XXX --path /planning/index.html

字符串
在cmd中运行良好,但在git bash中不行。一定是一些转义字符的问题,但我不太明白它应该是怎样的。

更新:错误消息Im getting in bash when calling the CreateInvalidation operation: Your request contains one or more invalid invalidation paths
已解决:通过提供cli-input-json解决

aws cloudfront create-invalidation --profile $PROFILE --cli-input-json "{\"DistributionId\":\"MY_DISTRIBUTION_ID\",\"InvalidationBatch\":{\"Paths\":{\"Quantity\":1,\"Items\":[\"/planning/index.html\"]},\"CallerReference\":\"$(date +%s)\"}}"```

qlfbtfca

qlfbtfca1#

在git bash中,这是一个很好的例子:

aws cloudfront create-invalidation --distribution-id XXX --path //index.html

字符串
斜杠必须是双斜杠。可能与此问题有关:Passing windows slash (/) based parameters to a program from bash script

相关问题