-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheasyrn.sh
executable file
·95 lines (76 loc) · 2.52 KB
/
easyrn.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
abort() {
printf "%s\n" "$@"
exit 1
}
# Check if bash is present
if [ -z "${BASH_VERSION:-}" ]
then
abort "Bash is required to interpret this script."
fi
# First check OS.
OS="$(uname)"
if [[ "${OS}" != "Darwin" ]]
then
abort "Easy RN is only supported on macOS."
fi
# TODO: Check if Xcode has been installed
# TODO: Check is Xcode command line tools are installed
# Allow user to select node version
select node_version in --lts 12.19.0 14.20.0
do
NODE_VERSION="$node_version"
break
done
# install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# installing xcpretty
sudo gem install xcpretty
# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# post setup nvm and android SDK location into zshrc
touch "$HOME"/.zshrc;
echo "export NVM_DIR=\"\$HOME/.nvm\"" >> "$HOME"/.zshrc;
echo "[ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\" # This loads nvm" >> "$HOME"/.zshrc;
echo "" >> "$HOME"/.zshrc;
echo "# export android SDK location" >> "$HOME"/.zshrc;
echo "export ANDROID_HOME=\$HOME/Library/Android/sdk" >> "$HOME"/.zshrc;
echo "export PATH=\$PATH:\$ANDROID_HOME/emulator" >> "$HOME"/.zshrc;
echo "export PATH=\$PATH:\$ANDROID_HOME/tools" >> "$HOME"/.zshrc;
echo "export PATH=\$PATH:\$ANDROID_HOME/tools/bin" >> "$HOME"/.zshrc;
echo "export PATH=\$PATH:\$ANDROID_HOME/platform-tools" >> "$HOME"/.zshrc;
source "$HOME"/.zshrc; nvm ls-remote
# install node lts via nvm ( nvm install --lts )
nvm install "$NODE_VERSION"
# install yarn ( npm install -g yarn )
npm install -g yarn
# install RN (brew install watchman)
brew install watchman
# brew install carthage
brew install carthage
# brew install cocoapods
brew install cocoapods
# brew tap wix/brew; brew install applesimutils
brew tap wix/brew; brew install applesimutils
# brew tap homebrew/cask
brew tap homebrew/cask;
brew install --cask adoptopenjdk/openjdk/adoptopenjdk11;
brew install android-studio --cask;
brew install android-platform-tools --cask;
brew install google-chrome --cask ;
brew install visual-studio-code --cask;
brew install webstorm --cask;
brew install reactotron --cask;
brew install slack --cask;
brew install intel-haxm --cask;
brew install charles --cask
brew install flipper --cask
# npx envinfo
npx envinfo
# generate an SSH key and display public key
if [ ! -f "$HOME/.ssh/id_rsa" ]
then
ssh-keygen -t rsa -b 2048 -C "$(whoami)'s RSA keypair" -f "$HOME"/.ssh/id_rsa -P '';
pbcopy < "$HOME"/.ssh/id_rsa.pub;
cat "$HOME"/.ssh/id_rsa.pub;
fi