我想用 ziplist.txt 压缩项目文件。但是在 7zip 命令中需要双引号。像这样,"\"@ziplist.txt\""
。结果,双引号被删除。如果你知道怎么做,请告诉我该怎么做。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "compress",
"type": "shell",
"command": "7z",
"args": [
"a",
"./release.zip",
"\"@ziplist.txt\""
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
ParserError:
Line |
1 | 7z a ./release.zip @ziplist.txt
| ~~~~~~~~
| The splatting operator '@' cannot be used to reference variables in an expression. '@ziplist' can be used only as an argument to a command. To
| reference variables in an expression using '$ziplist'.
The terminal process "C:\Program Files\PowerShell\7\pwsh.exe -Command 7z a ./release.zip "@ziplist.txt"" terminated with exit code: 1.
把双引号改成单引号!
这就是全部。谢谢。
任务文件
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "compress",
"type": "shell",
"command": "7z",
"args": [
"a",
"./release.zip",
"'@ziplist.txt'"
],
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句