Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ and `rtm obsidian 4330` would output
which could be written to a file in your Obsidian Vault.

```shell
rtm ls due:today | cut -wf1 | sort | xargs ./src/cli.js obsidian >> ~/LocalDocs/Test/Tasks/rtm.md
rtm ls due:today | cut -wf1 | sort | xargs rtm obsidian >> ~/LocalDocs/Test/Tasks/rtm.md
```
9 changes: 6 additions & 3 deletions src/cmd/obsidian.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,9 @@ function displayObsidianTask(idx, task) {
task.list_name = listName;

const location = LOCATION_MAP.get(location_id)
const locationName = location?.name || "Not found";
const locationTag = 'location/'+locationName.replace(/\s+/g, '-');
const locationName = location?.name;
let locationTag ='';
locationName ? locationTag = '#location/'+locationName.replace(/\s+/g, '-') : null ;
task.location = location;


Expand Down Expand Up @@ -147,7 +148,7 @@ function displayObsidianTask(idx, task) {
}

// Add list tag first, then other tags
const allTags = [`#${listTag}`, `#${locationTag}`, ...tags.map(t => `#${sanitizeTag(t)}`)];
const allTags = [`#${listTag}`, `${locationTag}`, ...tags.map(t => `#${sanitizeTag(t)}`)];
const tagStr = allTags.map(t => ` ${t}`).join('');
line += `${tagStr}`;

Expand Down Expand Up @@ -265,6 +266,8 @@ function exportDetails(idx, task) {
fs.mkdirSync(path.dirname(filePath), { recursive: true });
try {
fs.writeFileSync(filePath, content);
console.error(`Task detail files written to ${filePath}`)

} catch (e) {
console.error(`Failed to write details file for task ${idx}: ${e}`);
}
Expand Down