2023-05-08 12:48:59 +08:00

18 lines
588 B
TypeScript

import * as vscode from 'vscode';
import * as path from 'path';
import { createTempSubdirectory, runCommandStringAndWriteOutput } from '../util/commonUtil';
export async function handleRefCommand(ref_command: string) {
if (ref_command) {
const tempDir = await createTempSubdirectory('devchat/context');
const diff_file = path.join(tempDir, 'custom.txt');
const result = await runCommandStringAndWriteOutput(ref_command, diff_file);
console.log(result.exitCode);
console.log(result.stdout);
console.log(result.stderr);
return `[context|${diff_file}]`;
}
return '';
}