-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch-task4.js
More file actions
18 lines (13 loc) · 1.05 KB
/
Copy pathpatch-task4.js
File metadata and controls
18 lines (13 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const fs = require('fs');
const elasticFile = 'c:/Users/admin/Dropbox/Apps/remotely-save/Croptop/.obsidian/plugins/proxima/src/ui/views/ElasticView.svelte';
let elasticContent = fs.readFileSync(elasticFile, 'utf8');
const elasticTarget = ` const sBacklog = { id: 'backlog', name: 'Elastic Backlog', color: '#636e72' };
const sRunning = { id: 'running', name: 'Elastic Running', color: '#00b894' };
const sReview = { id: 'review', name: 'Elastic Review', color: '#fdcb6e' };`;
const elasticReplace = ` $: statuses = fileManager.plugin.settings.statuses || [];
$: sBacklog = statuses.find(s => s.id === 'backlog') || { id: 'backlog', name: 'Elastic Backlog', color: '#636e72' };
$: sRunning = statuses.find(s => s.id === 'running') || { id: 'running', name: 'Elastic Running', color: '#00b894' };
$: sReview = statuses.find(s => s.id === 'review') || { id: 'review', name: 'Finished', color: '#fdcb6e' };`;
elasticContent = elasticContent.replace(elasticTarget, elasticReplace);
fs.writeFileSync(elasticFile, elasticContent);
console.log('Patched ElasticView');