#15: Remove non-standard -s flag (basename) and fix whitespace
This commit is contained in:
parent
a5d9548ca7
commit
cf175d396b
12
compile.sh
12
compile.sh
|
@ -4,15 +4,15 @@
|
|||
|
||||
# compile SRC DESTINATION
|
||||
compile() {
|
||||
# Escape XML &<>'"
|
||||
src=`sed "s/\&/\&/g; s/</\</g; s/>/\>/g; s/'/\'/g; s/\"/\"/g" "$1"`
|
||||
# Escape XML &<>'"
|
||||
src=`sed "s/\&/\&/g; s/</\</g; s/>/\>/g; s/'/\'/g; s/\"/\"/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
|
||||
|
|
Loading…
Reference in New Issue