赞
踩
最近在Linux环境中部署了一套springboot项目,由于目录结构繁杂,jdk环境以及jar包引用问题,启停项目非常不方便,于是写了一个shell脚本,实现一键启停服务。在写shell脚本的时候,代码格式看着非常的不顺眼,便想整治一下。
在VSCode的插件栏位搜索shell-format,并点击安装
插件详情见:https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format
在安装完插件后,发现使用以上的两种方式均不能格式化代码,而控制台报有错误信息:
shfmt hasn't downloaded yet!Error: ENOENT: no such file or directory, stat 'c:\Users\Administrator\.vscode\extensions\foxundermoon.shell-format-7.2.5\bin\shfmt_v3.6.0_windows_amd64.exe'
Shfmt will be downloaded automatically!
download url: https://github.com/mvdan/sh/releases/download/v3.6.0/shfmt_v3.6.0_windows_amd64.exe
download to: c:\Users\Administrator\.vscode\extensions\foxundermoon.shell-format-7.2.5\bin\shfmt_v3.6.0_windows_amd64.exe
If the download fails, you can manually download it to the dest directory.
Or download to another directory, and then set the "shellformat.path" as the path
download shfmt page: https://github.com/mvdan/sh/releases
You can't use this plugin until the download is successful.
Effective shfmt flags: -i=4
Effective shfmt flags: -i=4
是无法从GitHub上下载文件导致的,可通过重试或者手动点击下载,shfmt_v3.6.0_windows_amd64
完成后,把文件放在c:\Users\Administrator.vscode\extensions\foxundermoon.shell-format-7.2.5\bin目录下。
重新进行格式化即可。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。