Skip to content

Latest commit

 

History

History
214 lines (149 loc) · 6.8 KB

README.md

File metadata and controls

214 lines (149 loc) · 6.8 KB

GitHub Workflow Status Code Linter Code Style

Repository Size Regression Runtime Min. Disk Space Occupied Last Regression Date

My personal installation script to automate any new macOS system setup so I don't need to feel poor.

  • A dogmatic script to set up my mac. Built for Mac OS X 🔥 🔥
  • The minimum storage space and runtime are only estimates; they may vary from machine to machine.
  • ⚠️ Still on experimental stage hence run at your own risk. ⚠️

Table of Contents

Installing / Getting started

⚠️ Scripts in this project performs automated tasks. Review the code first and use at your own risk! ⚠️

Setup

The script creates a centrally managed dotfiles directory on the ~ of the file system.

To setup simply open the terminal, then:

$ bash -c "`curl -L https://git.io/dotfiles-m1`"
# after initial setup
$ cd dotfiles && ./setup.sh

Developing

  • Make sure to lint the files prior to committing it.

Linting

💡 We make use of shellcheck and shfmt to lint the shell scripts,

Install the linters,

brew install shellcheck
brew install shfmt

Lint the files before making a PR,

shellcheck <file>.sh
shfmt -l -w -s <file>.sh # style linting

Sensible macOS defaults

When setting up a new Mac, you may want to set some sensible macOS defaults:

./macos/.macos

GPG key with Keybase.io

Projects

npm rebuild node-sass

Ant

asdf plugin add ant
asdf list-all ant
asdf install ant latest
asdf global ant latest
ant -version

Ndk Setup

💡 Install an older NDK version (20.*.* or lower) from android studio.

Installing an older NDK version (20.*.* or lower) will prevent the following flutter and react-native build errors,

FAILURE: Build failed with an exception.

*   What went wrong:
    Execution failed for task ':app:stripDebugDebugSymbols'.

> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

*   Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

*   Get more help at [https://help.gradle.org](https://help.gradle.org)

BUILD FAILED in 1m 4s
Exception: Gradle task assembleDebug failed with exit code 1

Fixing xcode path issue

$ sudo xcode-select --print-path
# if it something like /Library/Developer/..
$ sudo xcode-select --switch /Applications/Xcode.app

Run React Native App

# install and link (to install native dependencies)
$ asdf local nodejs 14.18.1
$ npm i
$ react-native link

# create a .dev.env file inside
$ npm run setupEnv
$ npm run start # start the metro bundler
$ npm run android:qa

iOS setup

Known issues;

# clean previous installs of ffi and cocoapods
$ gem list --local | grep cocoapods | awk '{print $1}' | xargs sudo gem uninstall
$ sudo gem uninstall ffi
$ rm -rf ~/.cocoapods/

# install ffi and cocoapods
$ sudo arch -x86_64 gem install ffi
$ sudo arch -x86_64 gem install cocoapods

# pod install inside the react-native project folder
$ cd react-native-owner-app/ios
$ pod install

Clean install pods

cleanpod # will clean install pods

Custom bash prompt

When your current working directory is a Git repository, the prompt will display the checked-out branch's name (and failing that, the commit SHA that HEAD is pointing to). The state of the working tree is reflected in the following way:

Symbol Description
+ Uncommitted changes in the index
! Unstaged changes
? Untracked files
$ Stashed files

Further details are in the .zsh_prompt file.

Notes

TODO

  • Auto-format shell files using brew install shellcheck && brew install shfmt && shfmt -l -w script.sh
  • Check precommit hook for linting
  • Dynamically add inputs to the buffer and check the initialize script
  • Run react-native setup as separate workflow.
  • Check on dotfilesdir="$HOME/${PWD##*/}" and see if it really works on all files.

License

MIT © 2021-2023 Murshid Azher.