mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-13 17:50:56 +01:00
developer: Update build.sh to remove redundant copyright comments
This commit is contained in:
parent
275c66b213
commit
50e9cd8caa
12
build.sh
12
build.sh
@ -261,7 +261,7 @@ pp_consolidate__do() {
|
|||||||
if will_minify lib; then
|
if will_minify lib; then
|
||||||
pp_strip_comments | pp_minify | pp_minify_unsafe
|
pp_strip_comments | pp_minify | pp_minify_unsafe
|
||||||
else
|
else
|
||||||
cat
|
pp_strip_copyright | pp_strip_separators
|
||||||
fi
|
fi
|
||||||
} < <(pp_consolidate__do "$((depth + 1))" < "$script") | sed "s/^/${indent}/"
|
} < <(pp_consolidate__do "$((depth + 1))" < "$script") | sed "s/^/${indent}/"
|
||||||
echo "${indent}# --- END LIBRARY FILE ---"
|
echo "${indent}# --- END LIBRARY FILE ---"
|
||||||
@ -306,6 +306,16 @@ pp_strip_comments() {
|
|||||||
sed '/^[[:space:]]*#.*$/d'
|
sed '/^[[:space:]]*#.*$/d'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Strips copyright comments from the start of a Bash source file.
|
||||||
|
pp_strip_copyright() {
|
||||||
|
awk '/^#/ {if(!p){ next }} { p=1; print $0 }'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Strips separator comments from the start of a Bash source file.
|
||||||
|
pp_strip_separators() {
|
||||||
|
awk '/^#\s*-{5,}/ { next; } {print $0}'
|
||||||
|
}
|
||||||
|
|
||||||
# Minify a Bash source file.
|
# Minify a Bash source file.
|
||||||
# https://github.com/mvdan/sh
|
# https://github.com/mvdan/sh
|
||||||
pp_minify() {
|
pp_minify() {
|
||||||
|
Loading…
Reference in New Issue
Block a user