Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc152f3f

Browse files
committed
fix: address CodeRabbit review feedback
- Fix manual config for unsupported clients to include all new flags- Improve environment parsing to handle edge cases (empty strings, duplicates)- Normalize environment names (lowercase, trim) for consistent matching- Ensure envOnly takes precedence over devOnly in all places
1 parentf3d9d3f commitc152f3f

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

‎packages/cli-v3/src/commands/install-mcp.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,21 @@ function handleUnsupportedClientOnly(options: InstallMcpCommandOptions): Install
287287
args.push("--api-url",options.apiUrl);
288288
}
289289

290-
if(options.devOnly){
290+
// Handle environment restrictions - envOnly takes precedence
291+
if(options.envOnly){
292+
args.push("--env-only",options.envOnly);
293+
}elseif(options.devOnly){
291294
args.push("--dev-only");
292295
}
293296

297+
if(options.disableDeployment){
298+
args.push("--disable-deployment");
299+
}
300+
301+
if(options.readonly){
302+
args.push("--readonly");
303+
}
304+
294305
if(options.projectRef){
295306
args.push("--project-ref",options.projectRef);
296307
}

‎packages/cli-v3/src/commands/mcp.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,15 @@ export async function mcpCommand(options: McpCommandOptions) {
130130
// Parse envOnly into an array if provided
131131
letenvOnly:string[]|undefined;
132132
if(options.envOnly){
133-
envOnly=options.envOnly.split(',').map(env=>env.trim());
133+
// Parse, normalize, and deduplicate environments
134+
envOnly=Array.from(
135+
newSet(
136+
options.envOnly
137+
.split(',')
138+
.map(env=>env.trim().toLowerCase())
139+
.filter(Boolean)// Remove empty strings
140+
)
141+
);
134142

135143
// Validate environment names
136144
constvalidEnvironments=['dev','staging','prod','preview'];

‎packages/cli-v3/src/mcp/context.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,13 @@ export class McpContext {
189189
}
190190

191191
publicisEnvironmentAllowed(environment:string):boolean{
192+
// Normalize the environment name for comparison
193+
constnormalizedEnv=environment.trim().toLowerCase();
194+
192195
// If envOnly is specified, use that (devOnly is already converted to envOnly)
193196
if(this.options.envOnly&&this.options.envOnly.length>0){
194-
returnthis.options.envOnly.includes(environment);
197+
// Note: envOnly is already normalized to lowercase in mcp.ts
198+
returnthis.options.envOnly.includes(normalizedEnv);
195199
}
196200

197201
// If no restrictions, all environments are allowed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp