forked from labbots/google-drive-upload
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmerge.sh
More file actions
executable file
·31 lines (24 loc) · 746 Bytes
/
merge.sh
File metadata and controls
executable file
·31 lines (24 loc) · 746 Bytes
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
#!/usr/bin/env sh
set -e
command -v shfmt 1>| /dev/null && ./format.sh && printf "\n"
_merge() (
shell="${1:?Error: give folder name.}"
cd "${shell}" 2>| /dev/null 1>&2 || exit 1
mkdir -p release
for file in upload sync; do
{
sed -n 1p "${file}.${shell}"
printf "%s\n" "SELF_SOURCE=\"true\""
sed 1d common-utils."${shell}"
[ "${file}" = upload ] &&
sed 1d auth-utils."${shell}" &&
sed 1d drive-utils."${shell}" &&
sed 1d upload-utils."${shell}"
sed 1d "${file}.${shell}"
} >| "release/g${file}"
chmod +x "release/g${file}"
done
printf "%s\n" "${shell} done."
)
_merge sh
_merge bash