mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
feat: add file targeting feature
This commit is contained in:
@@ -6,6 +6,8 @@ import { createScopedLogger } from '~/utils/logger';
|
||||
import { unreachable } from '~/utils/unreachable';
|
||||
import type { ActionCallbackData } from './message-parser';
|
||||
import type { BoltShell } from '~/utils/shell';
|
||||
import { isFileLocked } from '~/utils/fileLocks';
|
||||
import { isFileTargeted, hasTargetedFiles } from '~/utils/targetFiles';
|
||||
|
||||
const logger = createScopedLogger('ActionRunner');
|
||||
|
||||
@@ -304,6 +306,16 @@ export class ActionRunner {
|
||||
unreachable('Expected file action');
|
||||
}
|
||||
|
||||
if (isFileLocked(action.filePath).locked) {
|
||||
logger.warn(`Skipping locked file ${action.filePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasTargetedFiles() && !isFileTargeted(action.filePath)) {
|
||||
logger.info(`Skipping non-targeted file ${action.filePath}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const webcontainer = await this.#webcontainer;
|
||||
const relativePath = nodePath.relative(webcontainer.workdir, action.filePath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user