Compare commits
2 commits
db05998d6c
...
36d1221256
| Author | SHA1 | Date | |
|---|---|---|---|
| 36d1221256 | |||
| 4cfa7ed76b |
1 changed files with 9 additions and 3 deletions
|
|
@ -30,7 +30,7 @@ make_editable_copy() {
|
||||||
orig_file="$1"
|
orig_file="$1"
|
||||||
tempfile="$2"
|
tempfile="$2"
|
||||||
|
|
||||||
try_command cp "${orig_file}" "${tempfile}"
|
try_command cp -- "${orig_file}" "${tempfile}"
|
||||||
}
|
}
|
||||||
|
|
||||||
elevate_permissions() {
|
elevate_permissions() {
|
||||||
|
|
@ -45,15 +45,21 @@ update_file() {
|
||||||
tempfile="$1"
|
tempfile="$1"
|
||||||
orig_file="$2"
|
orig_file="$2"
|
||||||
|
|
||||||
try_command mv --force "${tempfile}" "${orig_file}"
|
try_command mv --force -- "${tempfile}" "${orig_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
clean_tempfiles() {
|
clean_tempfiles() {
|
||||||
tempfile="$1"
|
tempfile="$1"
|
||||||
|
|
||||||
rm --force "${tempfile}" "${tempfile}.orig"
|
rm --force -- "${tempfile}" "${tempfile}.orig"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [ "$#" -ne "1" ]; then
|
||||||
|
echo "Expected exactly one input file. Usage:" 1>&2
|
||||||
|
echo " $0 FILE" 1>&2
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
editor_cmd="$(default_editor)"
|
editor_cmd="$(default_editor)"
|
||||||
echo "Editing using the command \"${editor_cmd}\""
|
echo "Editing using the command \"${editor_cmd}\""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue