feat: Added support for remote files (via ssh).

This commit is contained in:
2026-10-15 14:25:53 -04:00
committed by Spencer Brower
parent d62123e831
commit e0e9c93577
11 changed files with 527 additions and 26 deletions
+12 -6
View File
@@ -16,11 +16,18 @@ cmd_remove :: proc(cmd: ^Command) {
return
}
abs_path, abs_err := filepath.abs(path, context.temp_allocator)
if abs_err != nil {
fmt.wprintf(cmd.err, "Error getting absolute path: %v\n", abs_err, flush = false)
resolved_path, _, _, is_remote, path_resolved := normalize_remote_identity(path)
if is_remote && !path_resolved {
return
}
if !is_remote {
abs_path, abs_err := filepath.abs(path, context.temp_allocator)
if abs_err != nil {
fmt.wprintf(cmd.err, "Error getting absolute path: %v\n", abs_err, flush = false)
return
}
resolved_path = abs_path
}
db, db_ok := db_open(cmd.flags.config_file)
if !db_ok {
@@ -28,10 +35,9 @@ cmd_remove :: proc(cmd: ^Command) {
}
defer db_close(&db)
if !db_delete(&db, abs_path) {
if !db_delete(&db, resolved_path) {
return
}
fmt.wprintf(cmd.out, "Removed %s from the database\n", abs_path, flush = false)
fmt.wprintf(cmd.out, "Removed %s from the database\n", resolved_path, flush = false)
}