# Don't overwrite an existing file/directory.
if test -e tmp; then
- echo "tmp/ already exists!"
+ echo 'tmp/ already exists!'
exit 1
fi
# Usage: cmd_i <cmd> ... <file>
#
# Run <cmd> with all arguments (including the last file) and write the result
-# to the temporary file <file>.tmp and then renamed that file to <file>. This
+# to the temporary file <file>.tmp and then rename that file to <file>. This
# can't be done in-place (e.g. cmd <file >file) because it truncates the file.
cmd_i() {
# Get last argument.
elif test x`uname` = xFreeBSD; then
echo freebsd
else
- echo unsupported OS! >&2
+ echo 'unsupported OS!' >&2
return 1
fi
}
target=`basename "$2"`
# Go to the directory where the link is going to be created.
- cd "$base"
+ cd "$base" || return 1
# Abort if the target file exists and is no symbolic link. Prevents
# overwriting real files.
# Generate a file from a source file using a given command. A warning not to
# edit it is automatically added to the created file.
#
-# Usage: generated() <file> <extension> <cmd..>
+# Usage: generate <file> <extension> <cmd..>
#
# If an empty extension is provided, the file is modified in-place (through a
# temporary file).