我可以从 vscode task.json 中的删除双引号中保存吗?

Shoutarou Take

问题

我想用 ziplist.txt 压缩项目文件。但是在 7zip 命令中需要双引号。像这样,"\"@ziplist.txt\""结果,双引号被删除。如果你知道怎么做,请告诉我该怎么做。

vscode 任务设置

{
    // 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.
Shoutarou Take

把双引号改成单引号!

这就是全部。谢谢。

任务文件

{
    // 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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

vscode中的task.json文件在哪里?

我可以在 vscode 中打开终端吗?

我可以在 VSCode IDE 上设置要使用的打字稿配置`tsconfig.json` 路径吗?

我可以禁用VsCode的更新通知吗?

我可以在vs代码中为一种以上的语言配置task.json文件吗?

我可以实时预览VSCode中的React组件吗?

我可以在vscode中定义替换操作的任务吗?

我可以在公司工作时使用 pycharm 社区或 vscode 吗?

我应该使用双引号JSON值吗

如何通过在Windows上使用cl.exe定义task.json以在vscode中编译C / C ++代码?

从JSON属性中删除双引号

如何从json中删除双引号

如何从 JSON 值中删除双引号 ""

我可以修改json.RawMessage吗?

我可以依靠JSON数组的顺序吗?

VSCode从我的正则表达式模式中保存时删除`\`

我可以在方法末尾安全删除await Task.CompletedTask调用吗?

我可以有条件地接管vscode扩展中的键绑定吗?

我可以使用VSCode在外部库中搜索吗?

我可以在 VSCode 中创建自定义片段吗?如果可能的话如何?

在Akka中,我可以在实例字段中保存ActorRef吗?

可以在VSCode中拖放打开文件吗?

我可以在Chrome中保存会话吗?

我可以在TileGDX中保存TiledMap吗?

我可以在Xamarin中声明没有Task块的任务吗?

双引号中的JSON值是有效的JSON吗?

我可以使用我的 mpd218 midi 鼓机在 VSCode 中运行构建任务吗?

我可以在流中返回格式化的 json 吗

我可以在OData结果中更改JSON属性吗?