-
Notifications
You must be signed in to change notification settings - Fork 0
/
fix-slim-release
executable file
·41 lines (32 loc) · 1.28 KB
/
fix-slim-release
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
#!/usr/bin/env bash
## SCRIPT TO FIX SLIM RELEASES
## This script is a nasty bit of hackery. Basically, instead of doing any kind
## of analysis, it solves the "erlang version mismatch" between a generated slim
## release and the installed erlang version. Rather than using a scalpel and
## carefully upgrading scripts and regenerating the boot files, it activates
## "HULK SMASH MODE" to solve this problem:
## 1) It removes the releases directory
## 2) it clones nitrogen into /tmp
## 3) it generates a slim_release in /tmp/myapp
## 4) It moves the newly generated releases directory into our project's directory
## This is as inelegant as can possibly be done, but it works.
# so we can get back
home=`pwd`
# nasty: clone nitrogen and generate a slim release using the current version
# of erlang so we can just copy the releases directory. A little embarrassingly
# stupid.
mkdir -p /tmp/nitrogen
cd /tmp
git clone git://github.com/nitrogen/nitrogen
cd nitrogen
## The generated release doesn't need anything more, and slim_inets has the
## fewest dependencies to build and fetch (since dependencies don't do anything
## for our releases directory anyway)
make slim_inets
# back to project dir
cd $home
rm -fr releases
mv /tmp/myapp/releases .
# clean up
rm -fr /tmp/nitrogen
rm -fr /tmp/myapp