-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_mac.sh
executable file
·64 lines (46 loc) · 1.39 KB
/
build_mac.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
#!/bin/sh
# Create your own Nibbler App
RED='\033[0;31m'
NC='\033[0m' # No Color
BOLD=$(tput bold)
NORM=$(tput sgr0)
ArmPrefix="/opt"
IntelPrefix="/usr/local/bin"
# If brew is installed exit else brew install
if [ "$(ls ${ArmPrefix} | grep homebrew )" = "homebrew" ] || [ "$(ls ${IntelPrefix} | grep brew)" = "brew" ] ; then
# Install npm if not installed
brew install node
# Install requirement electron
npm install -g electron
# Create App
npx create-electron-app Nibbler
# Get inside the app
cd Nibbler
# Remove the useless src
rm -r src
cd ..
# move everything into the new src
cp -r files/src Nibbler/
# move into the correct directory
cd Nibbler/src
# Change the name
mv main.js index.js
# Get into the previous directory
cd ..
# Create your final version
npm run make
# Move the Nibbler App checking the computer architecture
if [ "$(uname -m)" = "arm64" ] ; then
cd out/nibbler-darwin-arm64
mv nibbler.app /Applications/Nibbler.app
else
cd out/nibbler-darwin-x86_64
mv nibbler.app /Applications/Nibbler.app
fi
# Get back
cd ../../../
# Change icon
cp nibbler.icns /Applications/Nibbler.app/Contents/Resources/electron.icns
else
echo "${RED}You have to install brew follow the instruction -> ${NC}${BOLD}https://docs.brew.sh/Installation${NORM}"
fi