#15: Remove non-standard -s flag (basename) and fix whitespace

This commit is contained in:
Sean Yeh 2015-04-24 23:15:43 -05:00
parent a5d9548ca7
commit cf175d396b
1 changed files with 6 additions and 6 deletions

View File

@ -4,15 +4,15 @@
# compile SRC DESTINATION
compile() {
# Escape XML &<>'"
src=`sed "s/\&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/'/\&apos;/g; s/\"/\&quot;/g" "$1"`
# Escape XML &<>'"
src=`sed "s/\&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/'/\&apos;/g; s/\"/\&quot;/g" "$1"`
xbafile="$2"
name="`basename -s \".xba\" "$xbafile"`"
xbafile="$2"
name="`basename "$xbafile" \".xba\"`"
XBA_TEMPLATE='<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">\n<script:module xmlns:script="http://openoffice.org/2000/script" script:name="%s" script:language="StarBasic">\n%s\n</script:module>'
XBA_TEMPLATE='<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">\n<script:module xmlns:script="http://openoffice.org/2000/script" script:name="%s" script:language="StarBasic">\n%s\n</script:module>'
printf "$XBA_TEMPLATE" "$name" "$src" > "$xbafile"
printf "$XBA_TEMPLATE" "$name" "$src" > "$xbafile"
}
if [ "$#" -ne 2 ]; then