Просмотр исходного кода

bin/taud: fix a bug when adding a task to month_tasks

ghassmo 4 лет назад
Родитель
Сommit
0eff8d1b00
4 измененных файлов с 6 добавлено и 4 удалено
  1. 1 1
      bin/tau/README.md
  2. 3 1
      bin/tau/taud/src/month_tasks.rs
  3. 1 1
      bin/tau/taud_config.toml
  4. 1 1
      script/compile_all_bins.sh

+ 1 - 1
bin/tau/README.md

@@ -35,13 +35,13 @@ multiple users can collaborate by working on the same tasks, and all users will
 	
 	SUBCOMMANDS:
 	    add            Add a new task
+	    get            Get task by ID
 	    get-comment    Get task's comments
 	    get-state      Get task state
 	    help           Print this message or the help of the given subcommand(s)
 	    list           List open tasks
 	    set-comment    Set comment for a task
 	    set-state      Set task state
-	    show           Show task by ID
 	    update         Update/Edit an existing task by ID
 
 

+ 3 - 1
bin/tau/taud/src/month_tasks.rs

@@ -26,7 +26,9 @@ impl MonthTasks {
     }
 
     pub fn add(&mut self, ref_id: &str) {
-        self.task_tks.push(ref_id.into());
+        if !self.task_tks.contains(&ref_id.into()) {
+            self.task_tks.push(ref_id.into());
+        }
     }
 
     pub fn objects(&self) -> TaudResult<Vec<TaskInfo>> {

+ 1 - 1
bin/tau/taud_config.toml

@@ -5,7 +5,7 @@
 
 # Path to the dataset 
 dataset_path = "~/.config/tau"
-datastore_raft = "~/.config/tau.db"
+datastore_raft = "~/.config/tau/tau.db"
 
 # Path to DER-formatted PKCS#12 archive. (used only with tls url)
 # This can be created using openssl:

+ 1 - 1
script/compile_all_bins.sh

@@ -1,4 +1,4 @@
 #!/bin/sh
-bins="$(find bin -maxdepth 1 | tail -n+2 | sed 's,bin/,,' | tr '\n' ' ' |  sed 's,tau,,')"
+bins="$(find bin -maxdepth 1 | tail -n+2 | sed 's,bin/,,' | tr '\n' ' ' |  sed 's,\<tau\>,, ')"
 bins_tau="$(find bin/tau -maxdepth 1 | sed 's,bin/tau/,,' | grep -w 'taud\|tau-cli' | tr '\n' ' ')"
 make BINS="$bins_tau $bins"