-
Notifications
You must be signed in to change notification settings - Fork 1
/
package_elpa.sh
executable file
·53 lines (44 loc) · 1.05 KB
/
package_elpa.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
#!/bin/bash
if [ "$#" != "1" ]; then
echo "USAGE package_elpa.sh VERSION";
echo "./package_elpa.sh v0.0.7";
exit 1;
fi
version="$1"
echo "Packaging version ${version}..."
temp_dir=~/tmp/elpa-${version}
if [ -d ${temp_dir} ]; then
echo "Directory ${temp_dir} already exists."
exit 1;
fi
echo "Creating temp dir ${temp_dir}"
mkdir ${temp_dir}
if [ "$?" != "0" ]; then
echo "Failed to create temp dir.";
exit 1;
fi
echo "Copying files to temp directory ${temp_dir}..."
cp -r ./elpa/. ${temp_dir}/
if [ "$?" != "0" ]; then
echo "Failed to copy files.";
exit 1;
fi
echo "Deleting ELC files..."
find ${temp_dir} -iname '*.elc' -exec rm {} \;
if [ "$?" != "0" ]; then
echo "Failed to delete ELC files.";
exit 1;
fi
echo "Generating tarball..."
tar -zcf elpa-${version}.tgz -C ${temp_dir} .
if [ "$?" != "0" ]; then
echo "Failed to generate tarball.";
exit 1;
fi
echo "Deleting temp directory ${temp_dir}..."
rm -rf ${temp_dir}
if [ "$?" != "0" ]; then
echo "Failed to delete temp directory.";
exit 1;
fi
echo "Done"