-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from Okabe-Junya/Okabe-Junya/feat/install-script
Feature: Add Install Script
- Loading branch information
Showing
4 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#!/usr/bin/env zsh | ||
|
||
function check_os() { | ||
if [ "$(uname)" != "Darwin" ]; then | ||
echo "This script is only for Mac OS X" | ||
exit 1 | ||
else | ||
sleep 1 | ||
echo "This OS is Mac OS X!" | ||
fi | ||
if [ "$(uname -m)" != "arm64" ]; then | ||
echo "This Mac is Intel-based!" | ||
echo "This script is only for Apple Silicon" | ||
exit 1 | ||
else | ||
sleep 1 | ||
echo "This Mac is Apple Silicon!" | ||
fi | ||
} | ||
|
||
function install_command_line_tools() { | ||
if [ ! -d "/Library/Developer/CommandLineTools" ]; then | ||
echo "Installing Xcode Command Line Tools..." | ||
xcode-select --install 2>/dev/null | ||
else | ||
sleep 1 | ||
echo "Xcode Command Line Tools is already installed!" | ||
fi | ||
} | ||
|
||
function install_homebrew() { | ||
if [ ! -d "/opt/homebrew" ]; then | ||
echo "Installing Homebrew for Apple Silicon..." | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 2>/dev/null | ||
else | ||
sleep 1 | ||
echo "Homebrew for Apple Silicon is already installed!" | ||
fi | ||
} | ||
|
||
function initialize_symbolic_links() { | ||
echo "Initializing symbolic links..." | ||
source "${HOME}/dotfiles/install/symlink.zsh" | ||
} | ||
|
||
function brew_bundle_install() { | ||
echo "Installing Homebrew Bundle..." | ||
echo -n "Do you want to install Homebrew Bundle? [y/n]: " | ||
read answer | ||
case $answer in | ||
[yY]*) | ||
brew bundle install --file="${HOME}/dotfiles/install/Brewfile" | ||
;; | ||
*) | ||
echo "Homebrew Bundle is not installed!" | ||
;; | ||
esac | ||
} | ||
|
||
function install() { | ||
check_os | ||
install_command_line_tools | ||
install_homebrew | ||
brew_bundle_install | ||
|
||
echo "Installation is complete!" | ||
} | ||
|
||
install |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env zsh | ||
|
||
# config | ||
ln -nfs "${HOME}/dotfiles/.config/git" "${HOME}/.config/git" | ||
ln -nfs "${HOME}/dotfiles/.config/gh" "${HOME}/.config/gh" | ||
|
||
# zshrc | ||
ln -nfs "${HOME}/dotfiles/.zshrc" "${HOME}/.zshrc" |