nuagenetworks/nuxctl

nuxctl installation error due to incorrect use of tag parameter

apooniajjn opened this issue · 2 comments

Nuxctl Installation Error

I am trying to install nuxctl on my local macOS machine using the steps given on this URL : https://nuxctl.nuagex.io/#download-for-os-x .

Given steps:

  1. Install nuxctl using below commands:
latestUrl=$(curl -s https://github.com/nuagenetworks/nuxctl/releases/latest | cut -d '"' -f 2); \
tag=$(echo "${latestUrl: -6}"); \
curl -L https://github.com/nuagenetworks/nuxctl/releases/download/${tag}/nuxctl-darwin-amd64 > /usr/local/bin/nuxctl && \
chmod a+x /usr/local/bin/nuxctl && \
/usr/local/bin/nuxctl version
  1. Command Output:
➜  ~ latestUrl=$(curl -s https://github.com/nuagenetworks/nuxctl/releases/latest | cut -d '"' -f 2); \
tag=$(echo "${latestUrl: -6}"); \
curl -L https://github.com/nuagenetworks/nuxctl/releases/download/$\{tag\}/nuxctl-darwin-amd64 > /usr/local/bin/nuxctl && \
chmod a+x /usr/local/bin/nuxctl && \
/usr/local/bin/nuxctl version

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9    0     9    0     0     28      0 --:--:-- --:--:-- --:--:--    28
/usr/local/bin/nuxctl: line 1: Not: command not found
  1. As you can see it's adding \ value in front of tag parameter which fails to install nuxctl on my local machine. Even though when i copy commands in my text editor I don't see it

Solution

Pass Variable as per below in double quotes instead of curly bracket.

Old value:

  • curl -L https://github.com/nuagenetworks/nuxctl/releases/download/${tag}/nuxctl-darwin-amd64 > /usr/local/bin/nuxctl && \

New Value:

  • curl -L https://github.com/nuagenetworks/nuxctl/releases/download/"$tag"/nuxctl-darwin-amd64 > /usr/local/bin/nuxctl && \
➜  ~ latestUrl=$(curl -s https://github.com/nuagenetworks/nuxctl/releases/latest | cut -d '"' -f 2); \
tag=$(echo "${latestUrl: -6}"); \
curl -L https://github.com/nuagenetworks/nuxctl/releases/download/"$tag"/nuxctl-darwin-amd64 > /usr/local/bin/nuxctl && \
chmod a+x /usr/local/bin/nuxctl && \
/usr/local/bin/nuxctl version
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   610    0   610    0     0   1814      0 --:--:-- --:--:-- --:--:--  1810
100 10.2M  100 10.2M    0     0  5256k      0  0:00:01  0:00:01 --:--:-- 11.2M
0.6.0
➜  ~
hellt commented
hellt commented

fixed with proposed edit