mirror of
https://github.com/tiennm99/ccs.git
synced 2026-08-09 02:24:02 +00:00
fix(cli): match managed prompt files by exact path
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
|
||||
import {
|
||||
buildSteeringArg,
|
||||
hasManagedPromptFileArg,
|
||||
PROMPT_FLAG_INLINE,
|
||||
PROMPT_FLAG_FILE,
|
||||
} from '../prompt-injection-strategy';
|
||||
|
||||
const IMAGE_ANALYSIS_STEERING_PROMPT = {
|
||||
@@ -41,9 +41,8 @@ function hasExactFlagValue(params: {
|
||||
args: string[];
|
||||
flag: string;
|
||||
expectedValue: string;
|
||||
allowPartiallyMatch?: boolean;
|
||||
}): boolean {
|
||||
const { args, flag, expectedValue, allowPartiallyMatch } = params;
|
||||
const { args, flag, expectedValue } = params;
|
||||
|
||||
for (let index = 0; index < args.length; index += 1) {
|
||||
const arg = args[index];
|
||||
@@ -55,10 +54,6 @@ function hasExactFlagValue(params: {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (allowPartiallyMatch && value?.includes(expectedValue)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -88,12 +83,7 @@ function ensureImageAnalysisSteeringPrompt(args: string[]): string[] {
|
||||
}
|
||||
|
||||
if (
|
||||
hasExactFlagValue({
|
||||
args: optionArgs,
|
||||
flag: PROMPT_FLAG_FILE,
|
||||
expectedValue: IMAGE_ANALYSIS_STEERING_PROMPT.name,
|
||||
allowPartiallyMatch: true,
|
||||
})
|
||||
hasManagedPromptFileArg({ args: optionArgs, promptName: IMAGE_ANALYSIS_STEERING_PROMPT.name })
|
||||
) {
|
||||
return args;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user