feat(startup): create new chat with incrementing topic
This commit is contained in:
parent
3f82a60986
commit
2747a978c7
|
@ -162,10 +162,8 @@ export async function main() {
|
||||||
|
|
||||||
// Create a new chat on startup.
|
// Create a new chat on startup.
|
||||||
try {
|
try {
|
||||||
const countOutput = execFileSync('/home/jcarr/go/bin/regex', ['--count-auto'], { encoding: 'utf8' });
|
const topic = execFileSync('/home/jcarr/go/bin/regex', ['--get-next-auto-topic'], { encoding: 'utf8' });
|
||||||
const count = parseInt(countOutput.trim(), 10);
|
execFileSync('/home/jcarr/go/bin/regex', ['--new-chat', sessionId, topic.trim()]);
|
||||||
const topic = `Auto ${count + 1}`;
|
|
||||||
execFileSync('/home/jcarr/go/bin/regex', ['--new-chat', sessionId, topic]);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`Error creating new chat: ${e}`);
|
console.error(`Error creating new chat: ${e}`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue