Skip to content

Change install command to include -t option#1161

Open
mdierolf wants to merge 1 commit intoCircleCI-Public:mainfrom
mdierolf:install-command-directory
Open

Change install command to include -t option#1161
mdierolf wants to merge 1 commit intoCircleCI-Public:mainfrom
mdierolf:install-command-directory

Conversation

@mdierolf
Copy link

This pull request fixes an issue where the installer writes the circleci binary to a file name /usr/local/bin, if /usr/local/bin is not a directory

This should fix this error:

# rm /usr/local/bin 

# ls -la /usr/local/bin
ls: cannot access '/usr/local/bin': No such file or directory

# curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | bash
Starting installation.
Installing CircleCI CLI v0.1.33494
Installing to /usr/local/bin
An error occured installing the tool.
The contents of the directory /tmp/tmp.fBvjlvSUXG have been left in place to help to debug the issue.

# ls -la /usr/local/bin 
-rwxr-xr-x 1 root root 30974136 Nov 13 10:20 /usr/local/bin

After applying this patch, an install to a non-existent directory fails, instead of writing the file to the wrong place:

# curl -fLSs https://raw.githubusercontent.com/mdierolf/circleci-cli/refs/heads/install-command-directory/install.sh | bash
Starting installation.
Installing CircleCI CLI v0.1.33494
Installing to /usr/local/bin
install: failed to access '/usr/local/bin': No such file or directory
An error occured installing the tool.
The contents of the directory /tmp/tmp.HHJQp7j9K0 have been left in place to help to debug the issue.

# ls -la /usr/local/bin
ls: cannot access '/usr/local/bin': No such file or directory

The install command should treat the destination as a directory, not a file or directory. Added the -t option to the install command to implement this behavior
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

Successfully merging this pull request may close these issues.

1 participant