Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
794ff4a6
Commit
794ff4a6
authored
May 27, 2019
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
installer: add ability to skip the default shell change
Co-authored-by:
Marshall Ford
<
inbox@marshallford.me
>
Co-authored-by:
Joel Kuzmarski
<
leoj3n@gmail.com
>
parent
43b3126b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
install.sh
tools/install.sh
+21
-1
No files found.
tools/install.sh
View file @
794ff4a6
...
...
@@ -10,9 +10,12 @@
# sh install.sh
#
# Respects these environment variables for tweaking the installation process:
# ZSH - path to the Oh My Zsh repository folder (default: $HOME/.oh-my-zsh)
# REPO - name of the GitHub repo to install from (default: robbyrussell/oh-my-zsh)
# 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 - set to no tells the installer not to change the default shell (default: yes)
#
set
-e
...
...
@@ -22,6 +25,10 @@ REPO=${REPO:-robbyrussell/oh-my-zsh}
REMOTE
=
${
REMOTE
:-
https
://github.com/
${
REPO
}
.git
}
BRANCH
=
${
BRANCH
:-
master
}
# Other options
CHSH
=
${
CHSH
:-
yes
}
command_exists
()
{
command
-v
"
$@
"
>
/dev/null 2>&1
}
...
...
@@ -118,6 +125,11 @@ export ZSH=\"$ZSH\"
}
setup_shell
()
{
# Skip setup if the user wants or stdin is closed (not running interactively).
if
[
$CHSH
=
no
]
||
!
[
-t
0
]
;
then
return
fi
# If this user's login shell is already "zsh", do not attempt to switch.
if
[
"
$(
basename
"
$SHELL
"
)
"
=
"zsh"
]
;
then
return
...
...
@@ -161,6 +173,14 @@ setup_shell() {
}
main
()
{
# Parse arguments
while
[
$#
-gt
0
]
;
do
case
$1
in
--skip-chsh
)
CHSH
=
no
;;
esac
shift
done
setup_color
if
!
command_exists zsh
;
then
...
...
@@ -202,4 +222,4 @@ main() {
exec
zsh
-l
}
main
main
"
$@
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment