vself, vup: update to use err.msg instead of err
parent
1753445a64
commit
6814c975e5
|
@ -27,7 +27,7 @@ fn main() {
|
|||
// The user just wants an independent copy of v, and so we are done.
|
||||
return
|
||||
}
|
||||
backup_old_version_and_rename_newer() or { panic(err) }
|
||||
backup_old_version_and_rename_newer() or { panic(err.msg) }
|
||||
println('V built successfully!')
|
||||
}
|
||||
|
||||
|
@ -67,16 +67,16 @@ fn backup_old_version_and_rename_newer() ?bool {
|
|||
bak_file := os.real_path(short_bak_file)
|
||||
|
||||
list_folder('before:', 'removing $bak_file ...')
|
||||
os.rm(bak_file) or { errors << 'failed removing $bak_file: $err' }
|
||||
os.rm(bak_file) or { errors << 'failed removing $bak_file: $err.msg' }
|
||||
|
||||
list_folder('', 'moving $v_file to $bak_file ...')
|
||||
os.mv(v_file, bak_file) or { errors << err }
|
||||
os.mv(v_file, bak_file) or { errors << err.msg }
|
||||
|
||||
list_folder('', 'removing $v_file ...')
|
||||
os.rm(v_file) or {}
|
||||
|
||||
list_folder('', 'moving $v2_file to $v_file ...')
|
||||
os.mv_by_cp(v2_file, v_file) or { panic(err) }
|
||||
os.mv_by_cp(v2_file, v_file) or { panic(err.msg) }
|
||||
|
||||
list_folder('after:', '')
|
||||
|
||||
|
|
|
@ -124,9 +124,9 @@ fn (app App) show_current_v_version() {
|
|||
fn (app App) backup(file string) {
|
||||
backup_file := '${file}_old.exe'
|
||||
if os.exists(backup_file) {
|
||||
os.rm(backup_file) or { eprintln('failed removing $backup_file: $err') }
|
||||
os.rm(backup_file) or { eprintln('failed removing $backup_file: $err.msg') }
|
||||
}
|
||||
os.mv(file, backup_file) or { eprintln('failed moving $file: $err') }
|
||||
os.mv(file, backup_file) or { eprintln('failed moving $file: $err.msg') }
|
||||
}
|
||||
|
||||
fn (app App) git_command(command string) {
|
||||
|
|
Loading…
Reference in New Issue