Question: How to update curl version in Bash console?
megatux123 opened this issue · 5 comments
Question
Hello I use Cmder 1.3.24 on Windows 10 Version 21H2 (OS Build 19044.1288)
It happens I have downloaded an updated version 8.6.0 of the curl program from https://curl.haxx.se/windows
and installed it in a custom directory I included in the Windows OS PATH environment variable
With a CMD Cmder console this updated curl version checks when I use curl --version
and is used over both the default Windows and Cmder standard curl versions
However my problem is in a BASH Cmder console curl --version
shows an outdated version curl 8.1.2
and the command which curl
prints /mingw64/bin/curl
My question is what could be the official and fail-proof way to update the curl program to the last version for a BASH Cmder console ?
Checklist
- I have read the documentation and made sure what I'm looking for isn't present, or is unclear.
- I have searched for similar issues, and either this question wasn't asked before, or I didn't find any that describe my question.
Put the new curl.exe
in %cmder_root%/bin
This worked thank you I forgot about this option
Also sorry for the late reply but since I am not an advanced user I would like to ask what to do if the program exe has additional folders with libraries and files should I also copy them inside %cmder_root%/bin
?
For example the curl program full version download has this folder structure:
├───bin
├───dep
│ ├───brotli
│ ├───cacert
│ ├───libpsl
│ ├───libressl
│ ├───libssh2
│ │ └───docs
│ ├───nghttp2
│ ├───nghttp3
│ ├───ngtcp2
│ ├───zlib
│ └───zstd
├───docs
│ ├───examples
│ └───libcurl
├───include
│ ├───brotli
│ ├───curl
│ ├───nghttp2
│ ├───nghttp3
│ ├───ngtcp2
│ └───openssl
└───lib
with curl.exe
in its own bin
subfolder and at the same level what look like some important programming files in the include
and lib
folders
Should I copy all these curl folders to %cmder_root%/bin
even if they will be now a level below curl.exe ?
Thanks again for the help
Ok so I wanted to write one last update to this issue before I consider it settled
Since in this case the program .exe file is inside a nested folder structure I decided to delete everything from %cmder_root%/bin
and try to add my user defined PATH directory to the %cmder_root%/bin/config/user_profile.sh
bash file
To do that I write this command at the last line of user_profile.sh
export PATH="/c/User_Defined_PATH_Dir/curl/bin:$PATH"
This way "curl --version" detects the updated 8.6.0 in the Cmder Bash console. Also when I run "which curl" it points to the user defined install directory
The only side-effect is when I run "echo $PATH" it prints "/c/User_Defined_PATH_Dir/curl/bin" 2 times: at the start of the output and then a second time in the original position (since this Windows PATH was detected before but still the Bash console didnt use the updated 8.6.0 version... maybe because the entry order has changed now?)
I dont know if this is a bug or working as intended but I consider this a better solution when a program uses nested folders with libraries and dependencies
Thank you very much for the help Cmder is becoming my favorite software in Windows Im still learning but I will be sure to support it any way I can
there is no harm in what you have done but another approach might be to add an alias command to user-profile.sh
and remove the path modification:
alias curl='/c/User_Defined_PATH_Dir/curl/bin'
Additionally you could add the same command above to ~/.bashrc
to also set the same alias in Git Bash
launched outside Cmder.
I edited my last comment after I realized you were only trying to override curl path in Cmder bash.