A file-based task manager

FIX: symlinks using absolute paths

+17 -16
+13 -13
Cargo.lock
··· 395 395 396 396 [[package]] 397 397 name = "litemap" 398 - version = "0.7.3" 398 + version = "0.7.4" 399 399 source = "registry+https://github.com/rust-lang/crates.io-index" 400 - checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" 400 + checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" 401 401 402 402 [[package]] 403 403 name = "nix" ··· 591 591 592 592 [[package]] 593 593 name = "tsk" 594 - version = "0.1.0" 594 + version = "0.2.0" 595 595 dependencies = [ 596 596 "clap", 597 597 "clap_complete", ··· 614 614 615 615 [[package]] 616 616 name = "url" 617 - version = "2.5.3" 617 + version = "2.5.4" 618 618 source = "registry+https://github.com/rust-lang/crates.io-index" 619 - checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" 619 + checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" 620 620 dependencies = [ 621 621 "form_urlencoded", 622 622 "idna", ··· 826 826 827 827 [[package]] 828 828 name = "yoke" 829 - version = "0.7.4" 829 + version = "0.7.5" 830 830 source = "registry+https://github.com/rust-lang/crates.io-index" 831 - checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" 831 + checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" 832 832 dependencies = [ 833 833 "serde", 834 834 "stable_deref_trait", ··· 838 838 839 839 [[package]] 840 840 name = "yoke-derive" 841 - version = "0.7.4" 841 + version = "0.7.5" 842 842 source = "registry+https://github.com/rust-lang/crates.io-index" 843 - checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" 843 + checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" 844 844 dependencies = [ 845 845 "proc-macro2", 846 846 "quote", ··· 850 850 851 851 [[package]] 852 852 name = "zerofrom" 853 - version = "0.1.4" 853 + version = "0.1.5" 854 854 source = "registry+https://github.com/rust-lang/crates.io-index" 855 - checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" 855 + checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" 856 856 dependencies = [ 857 857 "zerofrom-derive", 858 858 ] 859 859 860 860 [[package]] 861 861 name = "zerofrom-derive" 862 - version = "0.1.4" 862 + version = "0.1.5" 863 863 source = "registry+https://github.com/rust-lang/crates.io-index" 864 - checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" 864 + checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" 865 865 dependencies = [ 866 866 "proc-macro2", 867 867 "quote",
+4 -3
src/workspace.rs
··· 132 132 // WARN: we could improperly increment the id if the task is not written to disk/errors. 133 133 // But who cares 134 134 let id = self.next_id()?; 135 + let task_name = format!("tsk-{}.tsk", id.0); 135 136 // the task goes in the archive first 136 - let task_path = self.path.join("archive").join(format!("tsk-{}.tsk", id.0)); 137 + let task_path = self.path.join("archive").join(&task_name); 137 138 let mut file = util::flopen(task_path.clone(), FlockArg::LockExclusive)?; 138 139 file.write_all(format!("{title}\n\n{body}").as_bytes())?; 139 140 // create a hardlink to the task dir to mark it as "open" 140 141 symlink( 141 - task_path, 142 - self.path.join("tasks").join(format!("tsk-{}.tsk", id.0)), 142 + PathBuf::from("../archive").join(&task_name), 143 + self.path.join("tasks").join(task_name), 143 144 )?; 144 145 Ok(Task { 145 146 id,