lewagon / setup

Setup instructions for Le Wagon's students on their first day of Web Development Bootcamp
https://www.lewagon.com
18.29k stars 1.6k forks source link

Setting `BROWSER` variable section is confusing right now #430

Closed SebiBasti closed 1 year ago

SebiBasti commented 1 year ago

In the current implementation of the setup the section Linking your default browser to Ubuntu causes a lot of tickets. In yesterdays windows setup day for Germany we had many problems with this because students collapse the section for their specific browser and then execute all the commands and unfortunately often don't realise the If you get an error like condition. We've been discussing different ways of formating this:

I wanted to open this issue to start a discussion on how we could make this section better. @v-natalia, @mdik & @ElvisDot anything you want to add?

v-natalia commented 1 year ago

Just adding that this is very common now, not only for the setup session that Sebi is commenting on. The students end up pasting all the commands and then when they reach the step of Github CLI, it is impossible to open a browser from the terminal. Data students too, but for them is more crucial because they use Jupyter notebook.

ssaunier commented 1 year ago

👋 Thanks for flagging! Which partial, in you opinion, should we update? What would be the wording?

PR welcomed 🙇 🙂

SebiBasti commented 1 year ago

@ssaunier I created a PR 👌

ElvisDot commented 11 months ago

Now the setting the browser section is before the dotfiles section so it will undo the changes.

First the browser step sets the EDITOR in the zshrc here

Then the dotfiles step replaces the current zshrc with the lewagon zshrc and undos the EDITOR change.

ssaunier commented 11 months ago

@ElvisDot I'm not sure I follow, could you please open a PR and have @sebibasti + @ogiles1999 as reviewer? Thanks!

ElvisDot commented 11 months ago

@ElvisDot I'm not sure I follow, could you please open a PR and have @SebiBasti + @ogiles1999 as reviewer? Thanks!

Im a bit too lazy to do that now sorry :stuck_out_tongue_winking_eye:

Its a chicken egg situation :chicken: :egg: . So the browser setup step is before the gh setup step so it opens the browser when authenticating with github. The gh is needed to clone the dotfiles. The dotfiles step then replaces the zshrc edit which added the EDITOR variable.

# https://github.com/ElvisDot/setup/blob/8eb7d0cc6b7bd6514b26fd9949791cc22135fe05/windows.md#linking-your-default-browser-to-ubuntu
echo "export BROWSER=\"/mnt/c/Program Files/Google/Chrome/Application/chrome.exe\"" >> ~/.zshrc
echo "export GH_BROWSER=\"'/mnt/c/Program Files/Google/Chrome/Application/chrome.exe'\"" >> ~/.zshrc

# https://github.com/lewagon/setup/blob/8eb7d0cc6b7bd6514b26fd9949791cc22135fe05/windows.md#github-cli
# we login expecting the BROWSER to be set in the zshrc
gh auth login -s 'user:email' -w

# https://github.com/lewagon/dotfiles/blob/adf05d5bffffc08ad040fb9c491ebea0350a5ba2/install.sh#L9
# now the lewagon dotfiles step undoes the EDITOR set in the zshrc
# which now causes the common data issue that jupyter notebook is not opening the browser
mv ~/.zshrc ~/.zshrc.backup

The way I see it either the browser setup step has to be done twice. Or the student has to manually click the link on the github auth step. Or the dotfiles script has to also copy over the BROWSER variables when setting up the zshrc.

SebiBasti commented 11 months ago

I guess updating the dotfiles script with the correct browser variables should do the trick.