@wrenautomation/aerie 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js CHANGED
@@ -41816,8 +41816,20 @@ async function mirror(a, root, o = {}) {
41816
41816
  } else r.wrote.push(target);
41817
41817
  touched.push(target);
41818
41818
  }
41819
+ const ids = new Set(tasks.map((t) => t.id));
41820
+ const fresh = [...disk.values()].filter((f) => !ids.has(f.task.id) && !state.has(f.task.id));
41821
+ if (fresh.length && !o.dryRun) {
41822
+ await a.importTasks(
41823
+ fresh.map((f) => ({ task: f.task, place: f.where })),
41824
+ o.by ?? "@backlog"
41825
+ );
41826
+ for (const f of fresh) {
41827
+ const now = await a.get(f.task.id);
41828
+ if (now) await a.setMirrorFile(now.id, f.path, sha(f.text), now.version);
41829
+ }
41830
+ }
41831
+ r.imported.push(...fresh.map((f) => f.path));
41819
41832
  if (!o.only) {
41820
- const ids = new Set(tasks.map((t) => t.id));
41821
41833
  for (const [id, m] of state) if (!ids.has(id)) r.left.push(m.path);
41822
41834
  }
41823
41835
  if (o.commit && touched.length && !o.dryRun) r.committed = commit(root, touched, o.commit);