Its purpose is to simplify the installation for smooth and effortless start. To execute this script, kindly adhere to the following instructions:
- Open the terminal and run the installation command: make -f Makefile i
- Open the terminal and run the updating command: make -f Makefile u
Sit back, relax, and enjoy the seamless experience!
P.S. You have the flexibility to configure the install_packages section according to your specific application needs
-
Setting up the shell and path:
- The
SHELLvariable is set to/bin/bash, indicating that the default shell used in the script is Bash. - The
PATHvariable is updated to include the/usr/local/bindirectory, ensuring that executables in that directory are accessible.
- The
-
Defining variables:
- The
ruby_versionvariable stores the latest Ruby version available fromrbenv install -l | grep -v - | tail -1. - The
current_ruby_versionvariable stores the currently installed Ruby version fromrbenv version | awk '{print $$1}'.
- The
-
Rule: xcode:
- The target
xcodechecks if thexcodebuildcommand is available. - If
xcodebuildis not found, it prompts the user to install Xcode and waits untilxcodebuildis available.
- The target
-
Rule: homebrew:
- The target
homebrewchecks if thebrewcommand is available. - If
brewis not found, it installs Homebrew by executing the installation script retrieved from the official Homebrew repository.
- The target
-
Rule: rbenv:
- The target
rbenvchecks if therbenvcommand is available. - If
rbenvis not found, it installs rbenv using Homebrew and adds the necessary configuration to the~/.bash_profilefile to initializerbenvin the shell.
- The target
-
Rule: ruby:
- The target
rubycompares the latest Ruby version (ruby_version) with the current Ruby version (current_ruby_version). - If they are different, it installs the latest Ruby version using
rbenv installand sets it as the global version usingrbenv global. - After installing Ruby, it runs
rbenv rehashto update the Ruby environment.
- The target
-
Rule: bundler:
- The target
bundlerchecks if thebundlercommand is available. - If
bundleris not found, it installs Bundler gem usinggem install --user-install bundlerand performsrbenv rehashto update the Ruby environment.
- The target
-
Rule: create_folder:
- The target
create_folderchecks if the~/Developerfolder exists. - If the folder does not exist, it creates it using
sudo mkdir -p ~/Developer.
- The target
-
Rule: packages_install:
- The target
packages_installinstalls various packages and applications using Homebrew (brew). - It installs packages like
cocoapods,fastlane,rbenv-bundler, and applications likeiterm2,slack,figma,fork, andtelegramusing thebrew installcommand.
- The target
-
Rule: rectangle:
- The target
package_install_rectangleprompts the user to choose between installingRectangleorRectangle Pro. - The user's choice is stored in the
answervariable using thereadcommand. - Depending on the user's choice, it installs the corresponding package (
rectangleorrectangle-pro) usingbrew install --cask.
- The target
-
Rule: packages_update:
- The target
packages_updateupgrades the installed packages and applications to their latest versions usingbrew upgrade. - It upgrades packages like
cocoapods,fastlane,rbenv-bundler, and applications like `iterm2
- The target
, slack, figma, fork, and telegram. - Additionally, if either rectangleorrectangle-pro` is already installed, it upgrades the corresponding package.
-
Rule: powerlevel10k:
- The target
powerlevel10kchecks if the~/.powerlevel10kfolder exists. - If the folder does not exist, it clones the Powerlevel10k theme repository from GitHub using
git clone. - It also adds the necessary configuration to the
~/.zshrcfile to enable the Powerlevel10k theme.
- The target
-
Rule: open_iterm2:
- The target
open_iterm2opens the iTerm2 application using theopen -a iTermcommand.
- The target
-
PHONY section:
- The
.PHONYsection lists all the targets that are not associated with actual files. - It ensures that these targets are always executed, regardless of whether a file with a matching name exists or not.
- The
-
Targets: install and update:
- The
installtarget sets up the development environment by executing the necessary rules in a specific order. - It includes targets like
xcode,homebrew,rbenv,ruby,bundler,create_folder,rectangle,packages_install,powerlevel10k, andopen_iterm2. - The
updatetarget updates the development environment by upgradingrbenv,ruby, and installed packages using thepackages_updaterule.
- The