-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-apply-patch.js
More file actions
26 lines (21 loc) · 1.11 KB
/
test-apply-patch.js
File metadata and controls
26 lines (21 loc) · 1.11 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
const fs = require('fs');
let code = fs.readFileSync('apps/desktop-ui/components/board/kanban-board.tsx', 'utf8');
if (!code.includes("import { ModelSelector }")) {
code = code.replace('import { DoneColumnContent } from "./done-column-content"\nimport { useRouter } from "next/navigation"', 'import { DoneColumnContent } from "./done-column-content"\nimport { ModelSelector } from "./model-selector"\nimport { useRouter } from "next/navigation"');
}
if (!code.includes("<ModelSelector />")) {
code = code.replace('<Icon className={`w-3 h-3 flex-shrink-0 ${tone.icon}`} />', '<Icon className={`w-3 h-3 flex-shrink-0 ${tone.icon}`} />');
// Actually we need to add ModelSelector as an item in the ProjectConfigPanel list or insert it as a child.
// Wait, let's just insert it after the items map
const insertionPoint = ` )
})}
<ModelSelector />
</div>
</div>`;
code = code.replace(` )
})}
</div>
</div>`, insertionPoint);
}
fs.writeFileSync('apps/desktop-ui/components/board/kanban-board.tsx', code);
console.log("Done");