/
copy-modified-h2-src.sh
executable file
·54 lines (44 loc) · 1.06 KB
/
copy-modified-h2-src.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
#!/bin/bash
set -e;
function usage()
{
echo 'USAGE: '$0' <command> [...]';
echo '';
echo 'COMMANDS:';
echo ' install <src dir path> Copy files to firefox source code directory';
echo ' config Generate configuration file';
}
if [ $# -lt 1 ] ; then
echo 'Too few arguments!';
usage;
exit 1;
fi
if [ $# -gt 2 ] ; then
echo 'Too many arguments!';
usage;
exit 1;
fi
if [ $1 != 'install' ] && [ $1 != 'config' ] ; then
echo 'Invalid command!';
usage;
exit 1;
fi
if [ $1 = 'install' ] && [ $# -eq 1 ] ; then
echo 'Too few arguments!';
usage;
exit 1;
fi
if [ $1 = 'install' ] && [ $# -eq 2 ] ; then
dest_root_dir=$2;
dest_http_protocol_dir=$2'/netwerk/protocol/http/';
if [ ! -d $dest_root_dir ] || [ ! -d $dest_http_protocol_dir ] ; then
echo 'Invalid path!';
usage;
exit 1;
fi
cp mozconfig $dest_root_dir;
cp *.cpp *.h moz.build $dest_http_protocol_dir;
elif [ $1 = 'config' ] ; then
cp mozconfig.example mozconfig;
fi
echo 'Done!'