Open federico-lox opened 4 weeks ago
You mean --getNimbleBin
, which is used by the init.sh
script.
But the output is from setNimbleDir
, which is imported from nimblepkg.options
and is called by newCliParams
, so in any case.
@SpotlightKid Yes, the —
is an artefact of iOS autocompletion. Fixed in OP.
It’s invoked here: https://github.com/nim-lang/choosenim/blob/162d73d07f05b16cc41f3542ee6a9133508d8daf/scripts/choosenim-unix-init.sh#L83
# Copy choosenim binary to Nimble bin.
local nimbleBinDir= '"$temp_prefix/$filename" --getNimbleBin'
That invocation doesn’t seem to account for the command outputting “Info: …” debug lines when NIMBLE_DIR is set for the environment.
@SpotlightKid Yes, the
—
is an artefact of iOS autocompletion. Fixed in OP.
My correction wasn't about the --
, but that the option is --getNimbleBin
, not --getNimbleDir
. :smile:
The "Info: ..." output goes to stdout, so it is captured by the shell backticks in the line you cited, there is no way to prevent that. So either nimble needs to be fixed to don't output those lines or the init.sh
script needs to use another way to determine the nimble bin dir.
The output is not triggered by the --getNimbleBin
option, but solely by the presence of the NIMBLE_DIR
env variable. E.g. try:
NIMBLE_DIR=/tmp/foo choosenim --help | head
which outputs:
Info: Using the environment variable: NIMBLE_DIR='/tmp/foo'
Info: Using the environment variable: NIMBLE_DIR='/tmp/foo'
choosenim: The Nim toolchain installer.
Choose a job. Choose a mortgage. Choose life. Choose Nim.
Usage:
choosenim <version/path/channel>
Example:
I’m setting the NIMBLE_DIR environment variable, and it seems that
choosenim --getNimbleDir
, which is used in the installation script to get the value, prints out debug info data when it doesn’t seem to be expected in the output, breaking the invitation ofcp
to move the downloaded binary to its permanent destination:I’m running on NixOS 24.05 and with bash 5.2.26 and it’s reproducible on the latest version of the script downloaded directly from this repo.