-
Notifications
You must be signed in to change notification settings - Fork 0
/
zipit
executable file
·77 lines (57 loc) · 1.71 KB
/
zipit
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
#!/bin/bash
CMD=${0##*/}
DIR=${0%/*}
# The repository
BASEDIR=$(realpath $DIR)
BUILD=$BASEDIR/build
BUILD9=$BUILD/splice9
SPLICE9_RLIB_DIR=$BUILD9/autoload/splice9/rlib
# source of raelity vim lib
RLIB_DIR=/src/lib/vim
set -e
#
# Runs in the directory where "zipit" is found.
# This is the top of the Splice9 source tree.
#
cd $BASEDIR
rm -rf $BUILD
mkdir -p $BUILD9
cp -a {plugin,doc,autoload} $BUILD9
# For release rename splice9dev to splice9
mv $BUILD9/autoload/splice9dev $BUILD9/autoload/splice9
# copy in raelity lib
rm -f $SPLICE9_RLIB_DIR
mkdir $SPLICE9_RLIB_DIR
cp -a $RLIB_DIR/{plugin,autoload} $SPLICE9_RLIB_DIR
# Adjust plugin startup file to use release directory "autoload/splice9"
sed -i \
-e '/^var ReleaseFlag = /s/false$/true/' \
$BUILD9/plugin/splice.vim
# Take "-dev" out of the version
sed -i \
-e '/^export.*splice9_string_version/s/-dev"$/"/' \
$BUILD9/plugin/splice.vim
# remove vim backup files and swap files and ...
rm $(find $BUILD9 -name '*~' -o -name '.??*')
# remove code lookup tags (not doc)
leftover_tags=$(find $BUILD9/autoload -name tags)
if [[ ! -z "$leftover_tags" ]]
then
rm $leftover_tags
fi
rm -f $BUILD9/doc/tags
vim -u NONE -c ":helptags $BUILD9/doc" -c ":quit"
# grab the string in quotes from the version definition
version=$(grep '^export.*splice9_string_version' $BUILD9/plugin/splice.vim \
| sed -E 's/^.*"(.+)".*$/\1/')
if [[ -z "$version" ]]
then
echo "Version number not found. Cannot package splice9 release zip" 2>&1
exit 1
fi
#echo "version:" $version $BUILD9
ZIP_FILE=$BASEDIR/splice9-$version.zip
rm -f $ZIP_FILE
cd $BUILD
zip -q -r $ZIP_FILE splice9
#jar -Mcvf splice9/splice9-$version.zip splice9/{plugin,doc,autoload}