Skip to content

Commit 7d9d56d

Browse files
committed
AK2: make backup only backup when needing backup
1 parent b6d48ee commit 7d9d56d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/ak2-core.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ write_boot() {
148148
}
149149

150150
# backup_file <file>
151-
backup_file() { cp $1 $1~; }
151+
backup_file() { test ! -f $1~ && cp $1 $1~; }
152152

153153
# replace_string <file> <if search string> <original string> <replacement string>
154154
replace_string() {

0 commit comments

Comments
 (0)