I want to compress project files with ziplist.txt . but then need double quotes in the 7zip command. like this , "\"@ziplist.txt\""
. as a result, double quotes are deleted.
so tell me what to do if you know how to.
{
// 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.
Changed the double quotes used inside to single quotes. This will work.
It's all. Thanks.
tasks.json
{
// 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
}
}
]
}