guarinogabriel / Mac-CLI

 macOS command line tool for developers – The ultimate tool to manage your Mac. It provides a huge set of command line commands that automatize the usage of your Mac.
MIT License
8.86k stars 334 forks source link

macOS Monterey /usr/local/bin/mac: Permission denied #183

Closed michaelpporter closed 1 year ago

michaelpporter commented 2 years ago

I am having this issue on macOS Monterey 12.5 MacBook Pro 14, 2021, M1 Pro

Similar to #150

Would you like Mac CLI to show you the commands that are run on each mac command? (Yes / No)Yes
Please enter your favourite text editor (by entering the command that opens your favourite editor. i.e: nano):
Press enter without any value to keep default: vi
sh: line 20: [: subl: binary operator expected
vim
cp: /usr/local/bin/mac: Permission denied
cp: /usr/local/bin/mac-cli: Permission denied
cp: /Users/michaelpporter/mac-cli/mac-cli/: unable to copy extended attributes to /usr/local/bin/mac-cli: Permission denied
cp: /usr/local/bin/mac-cli/misc: No such file or directory
cp: /Users/michaelpporter/mac-cli/mac-cli//misc: unable to copy extended attributes to /usr/local/bin/mac-cli/misc: No such file or directory
cp: /usr/local/bin/mac-cli/misc/help: No such file or directory
cp: /usr/local/bin/mac-cli/tools: No such file or directory
cp: /Users/michaelpporter/mac-cli/mac-cli//tools: unable to copy extended attributes to /usr/local/bin/mac-cli/tools: No such file or directory
cp: /usr/local/bin/mac-cli/tools/install: No such file or directory
cp: /usr/local/bin/mac-cli/tools/update: No such file or directory
cp: /usr/local/bin/mac-cli/tools/uninstall: No such file or directory
cp: /usr/local/bin/mac-cli/plugins: No such file or directory
cp: /Users/michaelpporter/mac-cli/mac-cli//plugins: unable to copy extended attributes to /usr/local/bin/mac-cli/plugins: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/general: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/network: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/brew: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/search: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/ssh: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/performance: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/volume: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/git: No such file or directory
cp: /usr/local/bin/mac-cli/completion: No such file or directory
cp: /Users/michaelpporter/mac-cli/mac-cli//completion: unable to copy extended attributes to /usr/local/bin/mac-cli/completion: No such file or directory
cp: /usr/local/bin/mac-cli/completion/fish_completion: No such file or directory
cp: /usr/local/bin/mac-cli/completion/bash_completion: No such file or directory
chmod: /usr/local/bin/mac-cli/*: No such file or directory
bndnio commented 2 years ago

I'm seeing a similar issue with macOS Monterey 12.2.1 MacBook Pro 16, 2021, M1 Pro

Running first, I get

> sh -c "$(curl -fsSL https://raw.githubusercontent.com/guarinogabriel/mac-cli/master/mac-cli/tools/install)"

================================================
 Mac CLI Installer
================================================

Cloning into 'mac-cli'...
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 29 (delta 1), reused 19 (delta 0), pack-reused 0
Receiving objects: 100% (29/29), 2.19 MiB | 5.07 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Would you like Mac CLI to show you the commands that are run on each mac command? (Yes / No)
Please enter your favourite text editor (by entering the command that opens your favourite editor. i.e: nano):
Press enter without any value to keep default: vi
Press ⌘V to insert current ()

bin not found
creating bin directory...
mkdir: /usr/local/bin: Permission denied
error in creating bin directory

Running sudo mkdir /usr/local/bin before the installer yielded

> sh -c "$(curl -fsSL https://raw.githubusercontent.com/guarinogabriel/mac-cli/master/mac-cli/tools/install)"

================================================
 Mac CLI Installer
================================================

Cloning into 'mac-cli'...
remote: Enumerating objects: 29, done.
remote: Counting objects: 100% (29/29), done.
remote: Compressing objects: 100% (26/26), done.
remote: Total 29 (delta 1), reused 20 (delta 0), pack-reused 0
Receiving objects: 100% (29/29), 2.19 MiB | 4.59 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Would you like Mac CLI to show you the commands that are run on each mac command? (Yes / No)
Please enter your favourite text editor (by entering the command that opens your favourite editor. i.e: nano):
Press enter without any value to keep default: vi
Press ⌘V to insert current ()

cp: /usr/local/bin/mac: Permission denied
cp: /usr/local/bin/mac-cli: Permission denied
cp: /Users/brendonearl/.dotfiles/mac-cli/mac-cli/: unable to copy extended attributes to /usr/local/bin/mac-cli: Permission denied
cp: /usr/local/bin/mac-cli/misc: No such file or directory
cp: /Users/brendonearl/.dotfiles/mac-cli/mac-cli//misc: unable to copy extended attributes to /usr/local/bin/mac-cli/misc: No such file or directory
cp: /usr/local/bin/mac-cli/misc/help: No such file or directory
cp: /usr/local/bin/mac-cli/tools: No such file or directory
cp: /Users/brendonearl/.dotfiles/mac-cli/mac-cli//tools: unable to copy extended attributes to /usr/local/bin/mac-cli/tools: No such file or directory
cp: /usr/local/bin/mac-cli/tools/install: No such file or directory
cp: /usr/local/bin/mac-cli/tools/update: No such file or directory
cp: /usr/local/bin/mac-cli/tools/uninstall: No such file or directory
cp: /usr/local/bin/mac-cli/plugins: No such file or directory
cp: /Users/brendonearl/.dotfiles/mac-cli/mac-cli//plugins: unable to copy extended attributes to /usr/local/bin/mac-cli/plugins: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/general: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/network: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/brew: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/search: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/ssh: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/performance: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/volume: No such file or directory
cp: /usr/local/bin/mac-cli/plugins/git: No such file or directory
cp: /usr/local/bin/mac-cli/completion: No such file or directory
cp: /Users/brendonearl/.dotfiles/mac-cli/mac-cli//completion: unable to copy extended attributes to /usr/local/bin/mac-cli/completion: No such file or directory
cp: /usr/local/bin/mac-cli/completion/fish_completion: No such file or directory
cp: /usr/local/bin/mac-cli/completion/bash_completion: No such file or directory
chmod: /usr/local/bin/mac-cli/*: No such file or directory
Installing Homebrew...
/usr/bin/ruby -e '$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)'

Warning: The Ruby Homebrew installer is now deprecated and has been rewritten in
Bash. Please migrate to the following command:
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

==> Checking for `sudo` access (which may request your password)...
==> This script will install:
/opt/homebrew/bin/brew
/opt/homebrew/share/doc/homebrew
/opt/homebrew/share/man/man1/brew.1
/opt/homebrew/share/zsh/site-functions/_brew
/opt/homebrew/etc/bash_completion.d/brew
/opt/homebrew

Press RETURN/ENTER to continue or any other key to abort:

And I then exited because I already had homebrew installed using the now current bash installer.

Any advise on how to proceed? It seems strange that the installer is trying to re-install brew at the end of it all

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.