Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the installer, add a way to "not" launch zsh after finishing #5002

Closed
luislobo opened this issue Apr 13, 2016 · 9 comments
Closed

In the installer, add a way to "not" launch zsh after finishing #5002

luislobo opened this issue Apr 13, 2016 · 9 comments
Labels
Area: installer Issue or PR related to the installer

Comments

@luislobo
Copy link

In the installer, add a way to "not" launch zsh after finishing.

It could be an environment variable that is being checked or whatever way you find appropriate.

I have my own "install_ubuntu.sh" that, in the middle, invokes OMZ installer, and I have to type exit everytime I want my installer to continue.

One way would be to leave it to the end.. but the installer should not just "nest" a shell call if you don't want to...

@mcornella
Copy link
Member

That's a very good use case, I think we can add a check to see if we're running interactively or not.

@luislobo
Copy link
Author

that would be great, I guess that will benefit some other people using it the same way

@loket
Copy link

loket commented Apr 24, 2017

Does #5893 solve your problem?

@luislobo
Copy link
Author

It should, but it didn't so far:

virtualbox_u1704_24_04_2017_16_20_45

The script is here https://raw.githubusercontent.com/luislobo/ubuntu-install-scripts/master/test.sh
Just tried it in a VirtualBox with Ubuntu 17.04.

@loket
Copy link

loket commented Apr 25, 2017

Ah, I see the problem.

Since the pull request hasn't been merged yet, the --batch argument won't be processed in the upstream installer. I updated by PR with better instructions.

Simply replace this line in your script:
oh_my_zsh_url="https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh"
with
oh_my_zsh_url="https://raw.githubusercontent.com/loket/oh-my-zsh/feature/batch-mode/tools/install.sh"

This will use the installer from my pull request instead of the upstream one. The upstream oh-my-zsh will be installed as before (not my fork), so you should be able to safely use this script until the pull request has been merged.

Hope that works! 😄

@mcornella
Copy link
Member

#5169 has added the option to disable that, either by setting the environment variable RUNZSH=no or passing the flag --unattended, which also skips the change of default shell. It has a bunch of other fixes, and it's now ready to test.

If you want to help speed up the testing and merge (which should happen early next week), you can wget or curl it from the URL https://raw.githubusercontent.com/mcornella/oh-my-zsh/refactor-installer/tools/install.sh. Read the comments at the top of the script to know how to call it.

Thanks!

@mcornella
Copy link
Member

Closed by #5169.

@vincentmader
Copy link

#5169 has added the option to disable that, either by setting the environment variable RUNZSH=no or passing the flag --unattended, which also skips the change of default shell. It has a bunch of other fixes, and it's now ready to test.

If you want to help speed up the testing and merge (which should happen early next week), you can wget or curl it from the URL https://raw.githubusercontent.com/mcornella/oh-my-zsh/refactor-installer/tools/install.sh. Read the comments at the top of the script to know how to call it.

Thanks!

Passing the flag "--unattended" to which command?

@mcornella
Copy link
Member

To the installer command, see:

  • https://github.com/ohmyzsh/ohmyzsh#unattended-install
  • ohmyzsh/tools/install.sh

    Lines 14 to 36 in ce9104c

    # You can tweak the install behavior by setting variables when running the script. For
    # example, to change the path to the Oh My Zsh repository:
    # ZSH=~/.zsh sh install.sh
    #
    # Respects the following environment variables:
    # ZSH - path to the Oh My Zsh repository folder (default: $HOME/.oh-my-zsh)
    # REPO - name of the GitHub repo to install from (default: ohmyzsh/ohmyzsh)
    # REMOTE - full remote URL of the git repo to install (default: GitHub via HTTPS)
    # BRANCH - branch to check out immediately after install (default: master)
    #
    # Other options:
    # CHSH - 'no' means the installer will not change the default shell (default: yes)
    # RUNZSH - 'no' means the installer will not run zsh after the install (default: yes)
    # KEEP_ZSHRC - 'yes' means the installer will not replace an existing .zshrc (default: no)
    #
    # You can also pass some arguments to the install script to set some these options:
    # --skip-chsh: has the same behavior as setting CHSH to 'no'
    # --unattended: sets both CHSH and RUNZSH to 'no'
    # --keep-zshrc: sets KEEP_ZSHRC to 'yes'
    # For example:
    # sh install.sh --unattended
    # or:
    # sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: installer Issue or PR related to the installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants