-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch-data-json.js
More file actions
43 lines (41 loc) · 1.15 KB
/
Copy pathpatch-data-json.js
File metadata and controls
43 lines (41 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const fs = require('fs');
const file = 'c:/Users/admin/Dropbox/Apps/remotely-save/Croptop/.obsidian/plugins/proxima/data.json';
let data = JSON.parse(fs.readFileSync(file, 'utf8'));
data.taskSchema = [
{
"id": "faction",
"name": "Assigned Faction",
"type": "select",
"options": [
{ "id": "solar", "name": "Solar Ascendancy", "color": "#fdcb6e" },
{ "id": "martian", "name": "Martian Conglomerate", "color": "#e84393" },
{ "id": "jovian", "name": "Jovian Federation", "color": "#0984e3" }
]
},
{
"id": "dependencies",
"name": "Dependencies",
"type": "relation"
},
{
"id": "base_cost",
"name": "Base Cost (EJ)",
"type": "number"
},
{
"id": "dep_cost_rollup",
"name": "Dependency Cost",
"type": "rollup",
"relationProperty": "dependencies",
"targetProperty": "base_cost",
"aggregation": "sum"
},
{
"id": "total_cost",
"name": "Total Cost Output",
"type": "formula",
"expression": "prop('Base Cost (EJ)') + prop('Dependency Cost') * 1.5"
}
];
fs.writeFileSync(file, JSON.stringify(data, null, 2));
console.log("Updated data.json with Dyson Sphere schema");