<repo_name>u5-03/mac-setup<file_sep>/Setting/terminal.sh
# 環境変数export LANG=ja_JP.UTF-8
export KCODE=u           # KCODEにUTF-8を設定

## 色を使用出来るようにする
autoload -Uz colors
colors

## 補完機能を有効にする
autoload -Uz compinit
compinit

## cdを使わずにディレクトリを移動できる
setopt auto_cd
## $ cd - でTabを押すと、ディレクトリの履歴が見れる
setopt auto_pushd

## タブ補完時に大文字小文字を区別しない
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}'

# Options
# 日本語ファイル名を表示可能にする
setopt print_eight_bit
# コマンドラインでも # 以降をコメントと見なす
setopt interactive_comments
# beep を無効にする
setopt no_beep
# rm *で確認を求める機能を無効化する
setopt RM_STAR_SILENT

# # Terminalのユーザー名を非表示にする
# PROMPT=$'%n [%*] -> %% '
# # 現在のパスを表示(文字を青色に設定)
# RPROMPT="%{${fg[blue]}%}[%~]%{${reset_color}%}"

# https://qiita.com/tocomi/items/c0127c44eded54b43c11
function powerline_precmd() {
    PS1="$(powerline-shell --shell zsh $?)
    $"
}

function install_powerline_precmd() {
  for s in "${precmd_functions[@]}"; do
    if [ "$s" = "powerline_precmd" ]; then
      return
    fi
  done
  precmd_functions+=(powerline_precmd)
}

if [ "$TERM" != "linux" ]; then
    install_powerline_precmd
fi

# PROMPT変数内で変数参照する
# setopt prompt_subst
# RPROMPT=$RPROMPT'${vcs_info_msg_0_}'

# vcsの表示
## vcs_infoロード
autoload -Uz vcs_info

# zstyle ':vcs_info:*' enable git svn hg bzr
# zstyle ':vcs_info:*' check-for-changes true
# zstyle ':vcs_info:*' stagedstr "%F{yellow}!"
# zstyle ':vcs_info:*' unstagedstr "%F{red}+"
# zstyle ':vcs_info:*' formats "%F{green}%c%u[%b]%f"
# zstyle ':vcs_info:*' actionformats '[%b|%a]'

# プロンプト表示直前にvcs_info呼び出し(プロンプトが表示されるたびに、実行される関数)
# precmd () {
#     psvar=()
#     LANG=en_US.UTF-8 vcs_info
#     [[ -n "$vcs_info_msg_0_" ]] && psvar[1]="$vcs_info_msg_0_"
# }

 export SHELL="/otp/homebrew/bin/zsh"<file_sep>/InitSettings/Dev/flutter-init.sh
# Flutter
flutter doctor

#JAVA
# Ref: https://zenn.dev/satokazur222/articles/66568417b291d8
sudo ln -sfn $(brew --prefix)/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk<file_sep>/Alias/dev-alias.sh
alias carthage='mint run carthage carthage'
alias cu='carthage update --platform iOS --cache-builds --no-use-binaries'
alias cb='carthage bootstrap --platform iOS --cache-builds'
alias xcodegen='mint run xcodegen xcodegen'
alias xg='xcodegen'
alias swiftgen='mint run swiftgen swiftgen'
alias xcconfigextractor-='mint run xcconfig-extractor xcconfig-extractor'
alias xe='xcconfig-extractor'
alias mb='mint bootstrap'
alias py='python'
alias fl='flutter'
alias fs='bundle exec fastlane'
alias swiftymocky='mint run SwiftyMocky swiftyMocky'
alias sm='swiftymocky'
alias sml='xcrun simctl list'
alias spg='swift package generate-xcodeproj'
<file_sep>/InitSettings/Dev/index.sh
sh $HOME/mac-setup/InitSettings/Dev/fastlane-init.sh
sh $HOME/mac-setup/InitSettings/Dev/flutter-init.sh
# sh $HOME/mac-setup/InitSettings/Dev/ionic-init.sh
sh $HOME/mac-setup/InitSettings/Dev/node-init.sh
sh $HOME/mac-setup/InitSettings/Dev/pod-init.sh
sh $HOME/mac-setup/InitSettings/Dev/python-init.sh
sh $HOME/mac-setup/InitSettings/Dev/terminal-init.sh
sh $HOME/mac-setup/InitSettings/Dev/xcode-init.sh
<file_sep>/InitSettings/Dev/terminal-init.sh
# Powerline-shell
# https://qiita.com/tocomi/items/c0127c44eded54b43c11

## Install Powerline-shell
git clone https://github.com/b-ryan/powerline-shell $HOME/dev-tool/powerline-shell
cd $HOME/dev-tool/powerline-shell
sudo python setup.py install
## Install fonts
git clone https://github.com/powerline/fonts.gszit --depth=1 $HOME/dev-tool/fonts
$HOME/dev-tool/fonts/install.sh
cd $HOME/dev-tool
cd $HOME
mkdir $HOME/.config/powerline
cp $HOME/SettingFiles/Powerline-shell/config.json $HOME/.config/powerline/config.json
cp $HOME/SettingFiles/Powerline-shell/mytheme.pyc $HOME/dev-tool/powerline-shell/powerline_shell/themes/mytheme.pyc
<file_sep>/InitSettings/Dev/gem-init.sh
# Bundler
sudo gem install bundler<file_sep>/InitSettings/Brewfile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "leoafarias/fvm"
brew "1password-cli"
brew "arp-scan"
brew "cloc"
brew "discord"
brew "cmake"
brew "colordiff"
brew "curl"
brew "lame"
brew "fvm"
brew "gh"
brew "goenv"
brew "gnu-sed"
brew "jq"
brew "kela"
brew "mas"
brew "mint"
brew "nodebrew"
brew "pyenv"
brew "rbenv"
brew "tcptraceroute"
brew "tfenv"
brew "tmux"
brew "translate-shell"
brew "wget"
brew "zplug"
brew "zsh-autosuggestions"
brew "zsh-completions"
brew "zsh-syntax-highlighting"
cask "1password", args: { appdir: "/Applications" }
cask "alfred", args: { appdir: "/Applications" }
cask "android-studio", args: { appdir: "/Applications" }
cask "appcleaner", args: { appdir: "/Applications" }
cask "balenaetcher"
cask "bettertouchtool", args: { appdir: "/Applications" }
cask "cheatsheet", args: { appdir: "/Applications" }
cask "dash", args: { appdir: "/Applications" }
cask "docker", args: { appdir: "/Applications" }
cask "finicky", args: { appdir: "/Applications" }
cask "google-japanese-ime", args: { appdir: "/Applications" }
cask "handbrake", args: { appdir: "/Applications" }
cask "imageoptim", args: { appdir: "/Applications" }
cask "iterm2", args: { appdir: "/Applications" }
cask "keyboardcleantool", args: { appdir: "/Applications" }
cask "menumeters", args: { appdir: "/Applications" }
cask "notion", args: { appdir: "/Applications" }
cask "postman", args: { appdir: "/Applications" }
cask "provisionql", args: { appdir: "/Applications" }
cask "sdformatter", args: { appdir: "/Applications" }
cask "sf-symbols", args: { appdir: "/Applications" }
cask "shiftit", args: { appdir: "/Applications" }
cask "sourcetree", args: { appdir: "/Applications" }
cask "svnx", args: { appdir: "/Applications" }
cask "the-unarchiver", args: { appdir: "/Applications" }
cask "visual-studio-code", args: { appdir: "/Applications" }
cask "vivaldi", args: { appdir: "/Applications" }
cask "vlc", args: { appdir: "/Applications" }
cask "wkhtmltopdf", args: { appdir: "/Applications" }
cask "xcodes", args: { appdir: "/Applications" }
mas "iMovie", id: 408981434
mas "Keynote", id: 409183694
mas "Numbers", id: 409203825
mas "Slack", id: 803453959
<file_sep>/Alias/git-alias.sh
# git Aliases
alias ga='git add'
alias gaa='git add -A'
alias gap='git add -p'
alias gaproj='git aproj'
alias gb='git branch'
alias gc='git commit'
alias gcl='git clone'
alias gca='git commit --amend'
alias gco='git checkout'
alias gcp='git cherry-pick'
alias gd='git diff'
alias gdt='git difftool'
alias gdc='git diff --cached'
alias gf='git fetch'
alias gfa='git fetch --all'
alias gfp='git fetch -p'
alias gl='git log'
alias gmnf='git merge --no-ff'
alias grb='git rebase'
alias grba='git rebase --abort'
alias grbc='git rebase --continue'
alias grbi='git rebase -i'
alias grbo='git rebase --onto'
alias grhe='git reset HEAD'
alias grha='git reset --hard'
alias grhs='git reset HEAD\^ --soft'
alias gst='git stash -u'
alias gstp='git stash pop'
alias gstpf='git stash pop #'
alias gstl='git stash list'
alias grbdev='git rebase origin/develop'
alias grbidev='git rebase -i origin/develop'
alias gcd='git reset HEAD .; git checkout .; git clean -df .'
alias gra='git remote add origin'
alias gpl='git pull origin'
alias gps='git push origin'
alias gpsf='git push -f origin'
alias gs='git status'
alias gsu='git submodule update --init --recursive'
alias gsuf='git submodule update --init --force --remote'
alias grc='git rm --cached'

function grh() {
  if [ ! -n "$1" ] && [ -e $1 ]; then
    echo "arg1: branch name is required!"
    return
  else
    git reset --hard origin/$1
  fi
}

function grb() {
  git rebase origin/$1
}

function grbi() {
  git rebase -i origin/$1
}

function gc() {
  git checkout $1
}
<file_sep>/InitSettings/init-download.sh
function command_exists {
  command -v "$1" > /dev/null;
}

#
# Install homebrew.
#
if ! command_exists brew ; then
  echo " --------- Homebrew ----------"
  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/$USER/.zprofile
  eval "$(/opt/homebrew/bin/brew shellenv)"

  brew doctor
  brew -v
  echo " ------------ Homebrew END ------------"
fi

#
# Install git
#
if ! command_exists git ; then
  echo " ------------ Git ------------"
  brew install git
  git --version
  echo " ------------ Git END ------------"
fi

#
# mac-auto-setup.git
#
echo " ---- mac-setup -----"
git clone https://github.com/u5-03/mac-setup.git
echo " ------------ mac-setup END ------------"
<file_sep>/Setting/dowload.sh
function isPrivateConfigSet() {
  if [ -e $HOME/SettingFiles/PrivateSettings/private-config.sh ]; then
    return 0
  else
    return 1
  fi
}

# GoogleDriveに保存したBetterTouchToolのライセンスファイルを指定ディレクトリに保存する。
function dlBtt() {
  if ! isPrivateConfigSet; then
    echo Could not load private config file!
    return
  fi
  savePath=$HOME/SettingFiles/BetterTouchToolsLicenceFile
  if [[ ! -e $savePath/$filename ]]; then
    mkdir -p $savePath
    curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
    curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o $savePath/${filename}
    echo Downloading licence file is complete!
  else
    echo Licence file already exist!
  fi
}<file_sep>/Alias/xcode-alias.sh
# Xcode関連のalias
alias deletederiveddata='rm -rf ~/Library/Developer/Xcode/DerivedData/*'
alias ddd='deletederiveddata'
alias xcv='xcversion'
alias xo='xcodeOpen'
alias rkb='replaceKeybindingFile'
alias sds='setDeviceSupport'
alias xsl='xcrun simctl list'
alias spg='swift package generate-xcodeproj'

## xcodeのバージョンを指定して、プロジェクトを開く($1: Xcodeのバージョン, $2: .xcodeproj/xcworkspace のパス)
function xcodeOpen() {
  # arg1/arg2のnullチェック
  if [ ! -n "$1" -o -z "$2" ]; then
    echo "arg1(xcode version number) and arg2(xcodeproj file path) are required!"; return
  fi
  # arg1の数値判定
  expr "$1 + 1" > /dev/null 2>&1
  if [ ! $? -lt 2 ]; then
    echo arg1 must be xcode version number!; return
  fi
  #arg1のバージョンのXcodeがアプリケーションフォルダにあるかどうかの判定
  XcodePath=/Applications/Xcode$1.app
  if [ ! -e $XcodePath ]; then
    echo Xcode$1.app does not exist in Applications directory!; return
  fi
  #arg2のパスに.xcodeproj/xcworkspaceがあるかどうかの判定
  if [ ! -e $2 ]; then
    echo "The path: $2 is not valid!"; return
  fi
  FileExtension=${2##*.}
  #拡張子がXcodeで開くことができるものかの判定
  if [ $FileExtension = "xcodeproj" -o $FileExtension = "xcworkspace" ]; then
    open -a $XcodePath $2
  else
    echo "$2 cannot be opend in Xcode!";
  fi
}

## xcodeのバージョンを指定して、KeyBindingFileをカスタムのものに置き換える($1: Xcodeのバージョン, $2: IDETextKeyBindingSet.plistのパス)
function replaceKeybindingFile() {
  # arg1のnullチェック
  if [ ! -n "$1" ]; then
    echo "arg1(xcode version number) is required!"; return
  fi
  # arg1の数値判定
  expr "$1 + 1" > /dev/null 2>&1
  if [ ! $? -lt 2 ]; then
    echo arg1 must be xcode version number!; return
  fi
  #arg1のバージョンのXcodeがアプリケーションフォルダにあるかどうかの判定
  XcodePath=/Applications/Xcode$1.app
  if [ ! -e $XcodePath ]; then
    echo Xcode$1.app does not exist in Applications directory!; return
  fi
  KeyBindingFilePath=""
  PrivateKeyBindingFilePath=$HOME/SettingFiles/Xcode/XcodekeyBinding/IDETextKeyBindingSet.plist
  if [ -n "$2" ] && [ -e $2 ] && [ `basename $2` = IDETextKeyBindingSet.plist ]; then
      KeyBindingFilePath=$2
  elif [ -e $PrivateKeyBindingFilePath ]; then
    KeyBindingFilePath=$PrivateKeyBindingFilePath
    echo Default file: $HOME/SettingFiles/Xcode/XcodekeyBinding/IDETextKeyBindingSet.plist will be used!
  else
    echo "arg2(`$KeyBindingFilePath`) is invalid!"; return
  fi
  XcodeKeyBindingFilePath="/Applications/Xcode$1.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/IDETextKeyBindingSet.plist"
  cp -f $KeyBindingFilePath $XcodeKeyBindingFilePath
  echo "keybinding file of Xcode$1.app was replaced!"
}

## Specify the iOS and Xcode version, download the DeviceSupport file and set it in the corresponding version Xcode ($1: iOS version, $2: Xcode version path)
function setDeviceSupport() {
  # null check of arg1
  if [ -z "$1" ]; then
    echo "arg1(iOS version number) is required! e.g. 14.6"; return
  fi
  # null check of arg2
  if [ -z "$2" ]; then
    echo "arg2(xcode version number) is required! e.g. 12.5"; return
  fi
  which svn
  echo "Clone $1 DeviceSupport zip from https://github.com/filsv/iOSDeviceSupport"
  svn export https://github.com/filsv/iOSDeviceSupport/trunk/$1.zip
  unzip $1.zip
  mv -f ./$1 /Applications/Xcode$2.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
  rm -f $1.zip
  rm -f -r __MACOSX
  echo "Set $1 Device Support file to Xcode$2!"
}
<file_sep>/README.md
# mac-setup

### Run following

①
```
sudo curl -fsSL https://raw.githubusercontent.com/u5-03/mac-setup/master/InitSettings/init-download.sh | sh
```
②
```
cd ./mac-setup
```
③
```
make setup
```<file_sep>/InitSettings/Dev/xcode-init.sh
if ! which xcversion >/dev/null; then
  echo xcode-install will be installed!
  sudo gem install xcode-install
else
  echo xcode-install is already installed!
fi

# cat ./UserSettings/xcode-version.sh | grep -v "#" | while read line || [ -n "${line}" ];
# do
#   xcversion install $line
# done
# echo Xcode install complete!<file_sep>/InitSettings/.finicky.js
// Generated by Finicky Kickstart
// Save as ~/.finicky.js

module.exports = {
  defaultBrowser: "Vivaldi",
  handlers: [
    {
      match: /^https?:\/\/app\.bitrise\.com\/.*$/,
      browser: "Safari"
    },
    {
      match: /^https?:\/\/console\.firebase\.google\.com\/.*$/,
      browser: "Safari"
    }
  ]
}<file_sep>/Alias/command-alias.sh
alias ls="ls -G"
alias tree="tree -NC -l"
alias mkdir="mkdir -p"
alias ...="cd ../.."<file_sep>/Setting/dev.sh
# Node
nodebrewPath=".nodebrew"
if [[ ! $PATH =~ $nodebrewPath ]]; then
  export PATH=$HOME/.nodebrew/current/bin:$PATH
fi
# Python
pythonPath=".pyenv"
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/shims:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv init --path)"
# Flutter
## Ref: https://zenn.dev/aiiro/articles/6df504554d57ef
flutterPath="$HOME/fvm/default/bin"
if [[ ! $PATH =~ $flutterPath ]]; then
  export PATH="$PATH:$flutterPath"
fi
## `Unable to find bundled Java version` => Run command below.
## Ref: https://qiita.com/y-matsumoto/items/74467e528c7b2c745b87
androidSDKPAth="$HOME/Library/Android/sdk/platform-tools"
if [[ ! $PATH =~ $androidSDKPAth ]]; then
  export PATH="$androidSDKPAth:$PATH"
fi
rbenv="$HOME/.rvenv/bin"
if [[ ! $PATH =~ $rbenv ]]; then
  export PATH="$PATH:$rbenv"
fi
rbenvShims="$HOME/.rvenv/shims"
if [[ ! $PATH =~ $rbenvShims ]]; then
  export PATH="$PATH:$rbenvShims"
fi
eval "$(rbenv init -)"
# Android
ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME:$ANDROID_HOME/emulator:$ANDROID_HOME/tools/:$ANDROID_HOME/platform-tools

# Ref: https://qiita.com/uhooi/items/74bdc893c7a7b43f6e94#android-studio%E3%81%AB%E5%90%8C%E6%A2%B1%E3%81%95%E3%82%8C%E3%81%A6%E3%81%84%E3%82%8Bjdk%E3%81%8C%E8%A6%8B%E3%81%A4%E3%81%8B%E3%82%89%E3%81%AA%E3%81%84
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jbr/Contents/Home
if [ -d "${JAVA_HOME}" ]; then
  export PATH="${JAVA_HOME}/bin:$PATH"
fi

# GitHubCLI
eval "$(gh completion -s zsh)"
<file_sep>/Setting/history.sh
# ヒストリの設定
# ヒストリの設定
HISTFILE=~/.sh_history
HISTSIZE=1000000
SAVEHIST=1000000
# 同じコマンドをヒストリに残さない
setopt hist_ignore_all_dups
# 同時に起動したzshの間でヒストリを共有する
setopt share_history
# ヒストリファイルに保存するとき、すでに重複したコマンドがあったら古い方を削除する
setopt hist_save_nodups
# スペースから始まるコマンド行はヒストリに残さない
setopt hist_ignore_space
# ヒストリに保存するときに余分なスペースを削除する
setopt hist_reduce_blanks
# 補完候補が複数あるときに自動的に一覧表示する
setopt auto_menu
# 高機能なワイルドカード展開を使用する
setopt extended_glob<file_sep>/Alias/custom-alias.sh
# custom-alias
alias sz='source ~/.zshrc'
alias opcd='open `pwd`'
alias nb='nodebrew'
alias sed='gsed'
alias paths="echo $PATH | tr ':' '\n'"

# Wifi設定alias
alias wfe='sudo networksetup -setairportpower en0 on'
alias wfd='sudo networksetup -setairportpower en0 off'
alias cwf='connectWifi'
function connectWifi() {
  sudo networksetup -setairportnetwork en0 $1 $2
}

##「悪質なソフトウェアかどうかをAppleで確認できないため、このソフトウェアを開けません。」のエラー時に、全てのアプリケーション実行を許可する(application-force-install)
alias afi='sudo spctl --master-disable'
alias afid='sudo spctl --master-enable'

## TerminalからMacをシャットダウンする
alias shutdown='sudo shutdown -h now'

##screenCaptureの保存先の変更
function ccd() {
  DIR=$HOME/Pictures/Captures
  if [ -n "$1" ] && [ -e $1 ]; then
    DIR=$1
  else
    if [ ! -d $DIR ]; then
      mkdir $DIR
    fi
  fi
  defaults write com.apple.screencapture location $DIR
  killall SystemUIServer
  echo Screen captures will be saved in $DIR!
}<file_sep>/zsh-config.sh
#PrivateConfigの読み込み
if [ -e $HOME/SettingFiles/PrivateSettings/private-config.sh ]; then
    source $HOME/SettingFiles/PrivateSettings/private-config.sh
fi

#分割している設定ファイルの読み込み
# DIRECTORY=`dirname $0`
DIRECTORY=$HOME/mac-setup
# ## Aliasの設定
source $DIRECTORY/Alias/index.sh
# ## 設定ファイル系の設定
source $DIRECTORY/Setting/index.sh

## 重複したPATHを削除
typeset -U PATH
<file_sep>/Setting/functions/index.sh
source $DIRECTORY/Setting/functions/function-setting.sh<file_sep>/InitSettings/Dev/ionic-init.sh
npm install ionic -g
npm install cordova -g<file_sep>/InitSettings/Dev/python-init.sh
# https://zenn.dev/kenghaya/articles/9f07914156fab5

version=3.10.6
pyenv install $version
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"

pyenv global $version

python --version<file_sep>/Setting/index.sh
source $DIRECTORY/Setting/dowload.sh
source $DIRECTORY/Setting/history.sh
source $DIRECTORY/Setting/terminal.sh
source $DIRECTORY/Setting/dev.sh
source $DIRECTORY/Setting/functions/index.sh
<file_sep>/InitSettings/Dev/node-init.sh
# Node
nodebrew setup

nodebrew install-binary stable
nodebrew use stable

export PATH="/usr/local/bin:$PATH"
export PATH=$PATH:$HOME/.nodebrew/current/bin<file_sep>/InitSettings/init-setting.sh
# finickyの設定ファイルをコピーする
# ref: https://github.com/johnste/finicky#installation
cp -f ./InitSettings/.finicky.js $HOME
## Brewfileに書かれたパッケージのインストール
brew bundle --file=./InitSettings/Brewfile

if [ -e ~/.zshrc ]; then
  touch ~/.zshrc
fi
# 個人用の設定リポジトリの取得
echo "--Setting of private config repository---------------------"
git clone https://github.com/u5-03/SettingFiles.git $HOME/SettingFiles
# PrivateConfigの読み込み
if [ -e $HOME/SettingFiles/PrivateInitSettings/private-repositories.sh ]; then
  source $HOME/SettingFiles/PrivateInitSettings/private-repositories.sh
  source $HOME/SettingFiles/PrivateInitSettings/working-repositories.sh
fi
echo source ~/mac-setup/zsh-config.sh > ~/.zshrc
source ~/.zshrc

# zshの設定
echo "--Setting of zsh------------------------------------------"
which -a zsh
sudo -- sh -c 'echo '/usr/local/bin/zsh' >> /etc/shells'
chsh -s /bin/zsh

# Screen captureの保存先を変更
ccd

# 各種開発ツールの設定
sh $HOME/mac-setup/InitSettings/Dev/index.sh

# Terminalでsudo実行時に、生体認証を使用する設定
setBiometricsAuthAsTouchID<file_sep>/Makefile
setup:
	sh ./InitSettings/init-setting.sh<file_sep>/InitSettings/Dev/ruby-init.sh
rbenv="$HOME/.rvenv/shims"
if [[ ! $PATH =~ $rbenv ]]; then
  export PATH="$PATH:$rbenv"
  eval "$(rbenv init -)"
fi
rbenv install<file_sep>/Setting/functions/function-setting.sh
if [ ! -e $HOME/mac-setup/Setting/functions/git-escape-magic ]; then
  # zshで^を使用する際に、自動でエスケープする関数
  curl  https://raw.githubusercontent.com/knu/zsh-git-escape-magic/master/git-escape-magic --output "$HOME/mac-setup/Setting/functions/git-escape-magic"
  export FPATH=$HOME/mac-setup/Setting/functions:$FPATH
fi

autoload -Uz git-escape-magic
# git-escape-magic

# Settings to use biometrics when running `sudo` in Terminal
function setBiometricsAuthAsTouchID() {
  echo "--Biometrics setting of terminal when use 'sudo'----------------------------"
  echo "Insert text below to 2nd line of '/etc/pam.d/sudo'"
  echo "auth       sufficient     pam_tid.so"
  while true; do
    echo -n "Did you copy ↑ text?(if yes, enter 'yes')"
    read ANS
    case $ANS in
      [Yy]*)
        # Enable user write permission 
        sudo chmod u+w /etc/pam.d/
        sudo vi /etc/pam.d/sudo
        return 0
        ;;
      *)
        echo "Enter yes"
        ;;
    esac
  done
}<file_sep>/Alias/index.sh
source $DIRECTORY/Alias/dev-alias.sh
source $DIRECTORY/Alias/git-alias.sh
source $DIRECTORY/Alias/custom-alias.sh
source $DIRECTORY/Alias/command-alias.sh
source $DIRECTORY/Alias/xcode-alias.sh