Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vs-shell-format should NOT download shfmt without asking #46

Closed
marmistrz opened this issue Jul 11, 2019 · 14 comments
Closed

vs-shell-format should NOT download shfmt without asking #46

marmistrz opened this issue Jul 11, 2019 · 14 comments

Comments

@marmistrz
Copy link

marmistrz commented Jul 11, 2019

I have my package manager to install shfmt and I definitely don't want the extension to fetch any blobs from the Internet. The extension keeps downloading it even when I delete the binary.

@foxundermoon
Copy link
Owner

foxundermoon commented Jul 12, 2019

you can just set the "shellformat.path": "/your/custompath"

@marmistrz
Copy link
Author

IIRC the binary was downloaded even when I set shellformat.path. Anyway, this is a workaround at most, the extension should ask before downloading anything. (just as the official Rust plugin does)

@foxundermoon
Copy link
Owner

👍good suggestion. you can pull request code.

@cig0
Copy link

cig0 commented Aug 4, 2019

Hi,

OTOH, regarding OP's observation, I'm good with the extension automatically fetching dependencies, unless there's a better way to handle custom installations of shfmt on different platforms (GNU+Linux and macOS here).

Please don't remove this feature :)

@singularitti
Copy link

Same issue here. I have shfmt installed at /usr/local/bin/shfmt. And my setting was like

{
"shellformat.path": "/usr/local/bin/shfmt",
}

But it still downloads shfmt anytime I open a shell script. I hope this could be fixed. It is annoying.

Info:

Version: 1.38.1
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:31:32.854Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0, macOS 10.14.6

@foxundermoon
Copy link
Owner

fix on v6.1.2

@David-Else
Copy link

David-Else commented Sep 24, 2019

I definitely want it to download shfmt for me! It seemed to just do it again even though it was previously installed? Maybe I did not boot vs code for a few days. Using Fedora 29 Linux, latest vs code.

shfmt hasn't downloaded yet!Error: ENOENT: no such file or directory, stat '/home/david/.vscode/extensions/foxundermoon.shell-format-6.1.2/bin/shfmt_v2.6.4_linux_amd64'
Shfmt will be downloaded automatically!
download url: https://github.com/mvdan/sh/releases/download/v2.6.4/shfmt_v2.6.4_linux_amd64
download to: /home/david/.vscode/extensions/foxundermoon.shell-format-6.1.2/bin/shfmt_v2.6.4_linux_amd64
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.
downloaded:[0.54%]
downloaded:[0.56%]
...
downloaded:[100.00%]
download success, You can use it successfully!
Suggestions or issues can be submitted here https://git.io/vsshell-issues

@pecigonzalo
Copy link

pecigonzalo commented Feb 14, 2020

@foxundermoon this seems to still download without asking. I agree auto-downloading is super useful for some people, but like the Go extension or others do, it should ask first.

IMO It should also not be parsing all my paths to find the binary, if you run this and its in the paths, it just runs, so there is no point in searching the PATH var

@foxundermoon
Copy link
Owner

foxundermoon commented Feb 16, 2020

@pecigonzalo if you don't need auto-download , please set shellformat.path configuration item.
searching PATH feature was deprecated. no longer supported!

@foxundermoon
Copy link
Owner

@David-Else
because the shfmt binary file was saved under the extension directory. so after the extension updated will redownload. the old extension directory was cleared by vscode.

@foxundermoon foxundermoon reopened this Feb 16, 2020
@foxundermoon foxundermoon removed the bug label Feb 16, 2020
@felipecrs
Copy link

I suggest to bundle the binaries with the extension, this would prevent the extension from "downloading automatically" the files.

@lpic10
Copy link

lpic10 commented Jan 21, 2021

I sync the settings on vscode and I use it on both Windows and Linux. To my surprise I found a binary with the name "C:\\Tools\\shfmt.exe" on my home folder on Linux.

Most extensions that need an external binary either ask to provide the path if not found, or ask to download the needed tools (eg. go).

@SuperSandro2000
Copy link

Was this changed? I can't find an entry in the changelog or in the commit log that matches this issue.

@felipecrs
Copy link

VSCode released support for platform specific extensions. I think it's just what this extension would need.

https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants