-
Notifications
You must be signed in to change notification settings - Fork 27
/
release.sh
executable file
·49 lines (39 loc) · 1.18 KB
/
release.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
#!/usr/bin/env sh
set -e
./format_and_lint.sh
printf "Merging Scripts and minifying...\n"
_PARENT_DIR="${PWD}"
cd src || exit 1
_merge() (
shell="${1:?Error: give folder name.}"
{ [ "${shell}" = "sh" ] && flag="-p"; } || flag=""
mkdir -p "${_PARENT_DIR}/release/${shell}"
release_path="${_PARENT_DIR}/release/${shell}/gdl"
{
sed -n 1p "${shell}/gdl.${shell}"
printf "%s\n" 'SELF_SOURCE="true"'
# shellcheck disable=SC2086
{
# this is to export the functions so that can used in parallel functions
echo 'set -a'
sed 1d "${shell}/common-utils.${shell}"
for script in \
update.sh \
parser.sh \
flags.sh \
auth-utils.sh \
common-utils.sh \
drive-utils.sh \
download-utils.sh \
gdl-common.sh; do
sed 1d "common/${script}"
done
echo 'set +a'
sed 1d "${shell}/gdl.${shell}"
} | shfmt -mn ${flag}
} >| "${release_path}"
chmod +x "${release_path}"
printf "%s\n" "${release_path} done."
)
_merge sh
_merge bash