nuagenetworks / nuxctl

NuageX CLI tool
https://nuxctl.nuagex.io/
BSD 3-Clause "New" or "Revised" License
3 stars 2 forks source link

nuxctl installation error due to incorrect use of tag parameter #18

Closed apooniajjn closed 5 years ago

apooniajjn commented 5 years ago

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
  2. 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:

New Value:

➜  ~ 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 5 years ago

Thanks Arun! Will fix it ASAP

чт, 24 янв. 2019 г., 23:30 Arun Poonia notifications@github.com:

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 curl bracket.

➜ ~ 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

➜ ~

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nuagenetworks/nuxctl/issues/18, or mute the thread https://github.com/notifications/unsubscribe-auth/AFaq9dphuY6XmgZglb_BmVBiehr8s5N6ks5vGhfagaJpZM4aRp77 .

hellt commented 5 years ago

fixed with proposed edit