-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrun_mix
executable file
·53 lines (40 loc) · 1.19 KB
/
run_mix
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
#!/bin/bash
set -e
# Setting up the PATH environment
[ -s /opt/homebrew/bin/brew ] && eval $(/opt/homebrew/bin/brew shellenv)
[ -s /usr/local/bin/brew ] && eval $(/usr/local/bin/brew shellenv)
# This loads nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# This loads asdf
if [ -s "$HOMEBREW_PREFIX/opt/asdf/libexec/asdf.sh" ]; then
\. "$HOMEBREW_PREFIX/opt/asdf/libexec/asdf.sh"
elif [ -s "$HOME/.asdf/asdf.sh" ]; then
\. "$HOME/.asdf/asdf.sh"
fi
BASE=`pwd`
export MIX_ENV=prod
export MIX_TARGET=ios
mix local.hex --force --if-missing
mix local.rebar --force --if-missing
if [ ! -d "elixir-app" ]; then
git clone https://github.com/elixir-desktop/desktop-example-app.git elixir-app
fi
# using the right runtime versions
if [ ! -f "elixir/.tool-versions" ]; then
cp .tool-versions elixir-app/
fi
cd elixir-app
if [ ! -d "deps/desktop" ]; then
mix deps.get
fi
if [ ! -d "assets/node_modules" ]; then
cd assets && npm i && cd ..
fi
if [ -f "$BASE/todoapp/app.zip" ]; then
rm "$BASE/todoapp/app.zip"
fi
mix assets.deploy && \
mix release --overwrite && \
cd _build/ios_prod/rel/todo_app && \
zip -9r "$BASE/todoapp/app.zip" lib/ releases/ --exclude "*.so"