mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 03:26:42 +00:00
feat(setup): make install.sh compatible with GitHub Codespaces
This commit is contained in:
48
install.sh
48
install.sh
@@ -206,13 +206,38 @@ git_clone() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
zsh_init() {
|
||||||
|
zsh -l -i -c 'exit'
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Argument Handling
|
# Argument Handling
|
||||||
#
|
#
|
||||||
|
|
||||||
|
display_help() {
|
||||||
|
echo 'usage: ./install.sh [-h/--help] [<command>]'
|
||||||
|
echo ''
|
||||||
|
echo 'Available commands:'
|
||||||
|
echo ' <none>: Run symlinks and shell_init commands.'
|
||||||
|
echo ' symlinks: Install symlinks for dotfiles into target directory.'
|
||||||
|
echo ' shell_init: Launch zsh instance so zinit installs all deps.'
|
||||||
|
echo ' info: Display target and source directory information.'
|
||||||
|
echo ' emacs_config: Install Emacs configuration.'
|
||||||
|
echo ' private: Install private dotfiles.'
|
||||||
|
echo ' homebrew: Install Homebrew (Mac OS X only).'
|
||||||
|
echo ' rbenv: Install rbenv, a Ruby version manager.'
|
||||||
|
echo ' launch_agents: Install launchd plists to ~/Library/LaunchAgents/'
|
||||||
|
echo ' help: Display this message.'
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ " $* " == *" --help "* ]] || [[ " $* " == *" -h "* ]]; then
|
||||||
|
display_help
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
symlinks | links)
|
"help")
|
||||||
install_symlinks
|
display_help
|
||||||
;;
|
;;
|
||||||
emacs-config | emacs)
|
emacs-config | emacs)
|
||||||
install_emacs_config
|
install_emacs_config
|
||||||
@@ -236,17 +261,14 @@ case "$1" in
|
|||||||
echo "Target directory: $TARGET"
|
echo "Target directory: $TARGET"
|
||||||
echo "Detected dotfiles root: $ROOT_PATH"
|
echo "Detected dotfiles root: $ROOT_PATH"
|
||||||
;;
|
;;
|
||||||
|
shell_init)
|
||||||
|
zsh_init
|
||||||
|
;;
|
||||||
|
symlinks | links)
|
||||||
|
install_symlinks
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo 'usage: ./install.sh [command]'
|
install_symlinks
|
||||||
echo ''
|
zsh_init
|
||||||
echo 'Available commands:'
|
|
||||||
echo ' info: Target and source directory info.'
|
|
||||||
echo ' symlinks: Install symlinks for various dotfiles into' \
|
|
||||||
'target directory.'
|
|
||||||
echo ' emacs_config: Install Emacs configuration.'
|
|
||||||
echo ' private: Install private dotfiles.'
|
|
||||||
echo ' homebrew: Install Homebrew (Mac OS X only).'
|
|
||||||
echo ' rbenv: Install rbenv, a Ruby version manager.'
|
|
||||||
echo ' launch_agents: Install launchd plists to ~/Library/LaunchAgents/'
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user