neuefische / web-setup

💻 macOS setup using zsh for the web development course
30 stars 5 forks source link

script is doing the 3 brew commands automatically after brew installation #3

Closed mpagels closed 1 year ago

mpagels commented 1 year ago

What was the problem

In the first step of the script, brew is installed. The normal installation of brew requires a manual input of three lines of code in the terminal after the installation process to put brew into PATH and get recognized from the OS.

In the current state of the script, the user has no opportunity to do that, because the script is running through. And there are a lot of errors, because the script can not find brew in PAHT and is not installation the software.

This pr fixes #2 this problem.

What was done here

Line 10 to 78 makes sure, on what OS the script is running to create the important ${shell_profile} and ${HOMEBREW_PREFIX} variable. This was just copied from the brew install script.

The important part, where the magic happens, is line 80 to 85.

I tried the script with a new user on my M1 MacBook. This went through. Before merging this into main I really want to test it on a very new machine.

Pls try this script with this command and check if everything went well. Pls contact me if something went wrong.

zsh <(curl -s https://raw.githubusercontent.com/neuefische/web-setup/fix/script-is-doing-the-three-steps-after-brew-installation/setup)

If something went wrong, it is important to empty/delete the following lines in the .zprofile file. Because the script append it and when the script is running again, the lines are duplicated.

# Set PATH, MANPATH, etc., for Homebrew.' >> .zprofile
eval “$(/opt/homebrew/bin/brew shellenv)”
mpagels commented 1 year ago

I tried the script on the following devices:

* Macbook Pro with M1

* Macbook Pro with Intel

Awesome. Thank you, Andrea.

mpagels commented 1 year ago

The script runs under a fresh linux ubuntu 22.04 OS

It is executing these lines as well

for x in iterm2 visual-studio-code rectangle quicklook-json; do brew install --cask $x; done;
brew install --cask firefox-developer-edition --lang=en-US;

but as these are macOS software, it is followed by this error message

Error: Invalid `--cask` usage: Casks do not work on Linux
Error: Invalid `--cask` usage: Casks do not work on Linux
Error: Invalid `--cask` usage: Casks do not work on Linux
Error: Invalid `--cask` usage: Casks do not work on Linux
Error: Invalid `--cask` usage: Casks do not work on Linux

Installed macOS apps:
Error: Invalid `--cask` usage: Casks do not work on Linux

The script went through and everything except the macOS software was installed. I needed to reboot the linux system to get the software recognized.

Some hiccups I discovered while testing the script under a fresh installed linux.

To use the script you need to install zsh, curl and git manually before even running itself.

Do this before following steps at first

install curl sudo apt install curl

install zsh sudo apt install zsh

install git sudo apt install git-all

run the web-setup script

nikokreissl commented 1 year ago

Niko from bo-web-23-1

Working perfectly fine for me! :slightly_smiling_face: