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

Install script fails if NIMBLE_DIR env is present #307

Open
yyoncho opened this issue Sep 20, 2022 · 5 comments
Open

Install script fails if NIMBLE_DIR env is present #307

yyoncho opened this issue Sep 20, 2022 · 5 comments

Comments

@yyoncho
Copy link

yyoncho commented Sep 20, 2022

curl https://nim-lang.org/choosenim/init.sh -sSf | sh fails because nimble is printing a warning if NIMBLE_DIR is set. One way to fix the issue is to raise the logging level in Nimble Options.

@yyoncho
Copy link
Author

yyoncho commented Sep 20, 2022

I can do the fix if we agree on that:

One way to fix the issue is to raise the logging level in Nimble Options.

@dom96
Copy link
Owner

dom96 commented Sep 20, 2022

In what way does it fail? Can you share output?

@yyoncho
Copy link
Author

yyoncho commented Sep 20, 2022

yyoncho@myoncho /tmp/echo % curl https://nim-lang.org/choosenim/init.sh -sSf |  NIMBLE_DIR=. sh -x
+ set -u
+ set -e
+ url_prefix=https://github.com/dom96/choosenim/releases/download/
+ temp_prefix=/tmp
+ CHOOSE_VERSION=stable
+ need_tty=yes
+ debug=
+ getopts dy opt
+ install
+ get_platform
+ uname -m
+ local ucpu=x86_64
+ uname
+ local uos=Linux
+ echo x86_64
+ tr [:upper:] [:lower:]
+ local ucpu=x86_64
+ echo Linux
+ tr [:upper:] [:lower:]
+ local uos=linux
+ local myos=linux
+ local mycpu=amd64
+ RET_VAL=linux_amd64
+ local platform=linux_amd64
+ local stable_version=
+ has_curl
+ command -v curl
+ curl -sSfL https://nim-lang.org/choosenim/stable
+ stable_version=0.8.4
+ local filename=choosenim-0.8.4_linux_amd64
+ local url=https://github.com/dom96/choosenim/releases/download/v0.8.4/choosenim-0.8.4_linux_amd64
+ local ext=
+ say Downloading choosenim-0.8.4_linux_amd64
+ echo choosenim-init: Downloading choosenim-0.8.4_linux_amd64
choosenim-init: Downloading choosenim-0.8.4_linux_amd64
+ has_curl
+ command -v curl
+ curl -sSfL https://github.com/dom96/choosenim/releases/download/v0.8.4/choosenim-0.8.4_linux_amd64 -o /tmp/choosenim-0.8.4_linux_amd64
+ chmod +x /tmp/choosenim-0.8.4_linux_amd64
+ [ yes = yes ]
+ [ ! -t 1 ]
+ /tmp/choosenim-0.8.4_linux_amd64 stable --firstInstall
   Warning: Using the environment variable: NIMBLE_DIR='.'
      Info: Version 1.6.6 already selected
+ /tmp/choosenim-0.8.4_linux_amd64 --getNimbleBin
+ local nimbleBinDir= Warning: Using the environment variable: NIMBLE_DIR='.' /tmp/echo/bin
sh: 83: local: Warning:: bad variable name

@dom96
Copy link
Owner

dom96 commented Sep 20, 2022

Oh I see. Nimble has https://github.com/nim-lang/nimble/blob/master/src/nimblepkg/cli.nim#L24 for these problems, the real fix would be to set that to true when --getNimbleBin is specified. Though I'm not sure if doing so is non-trivial.

@yyoncho
Copy link
Author

yyoncho commented Sep 27, 2022

The following is good enough to make it work for unix(if someone has the windows equivalent at hand I can provide a PR).

yyoncho@efd86e6

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

No branches or pull requests

2 participants