Skip to content

Commit 24e9355

Browse files
committed
create - force --no-open when inside Posit Workbench
1 parent 6945ee5 commit 24e9355

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/command/create/cmd.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import { extensionArtifactCreator } from "./artifacts/extension.ts";
88
import { projectArtifactCreator } from "./artifacts/project.ts";
99
import { kEditorInfos, scanForEditors } from "./editor.ts";
1010

11-
import { isInteractiveTerminal } from "../../core/platform.ts";
11+
import {
12+
isInteractiveTerminal,
13+
isRStudioWorkbench,
14+
} from "../../core/platform.ts";
1215
import { runningInCI } from "../../core/ci-info.ts";
1316

1417
import { Command } from "cliffy/command/mod.ts";
@@ -56,6 +59,16 @@ export const createCommand = new Command()
5659
const isInteractive = isInteractiveTerminal() && !runningInCI();
5760
const allowPrompt = isInteractive && !!options.prompt && !options.json;
5861

62+
// Specific case where opening automatically in an editor is not allowed
63+
if (options.open !== false && isRStudioWorkbench()) {
64+
if (options.open !== undefined) {
65+
info(
66+
`The --open option is not supported in Posit Workbench - ignoring`,
67+
);
68+
}
69+
options.open = false;
70+
}
71+
5972
// Resolve the type into an artifact
6073
const resolved = await resolveArtifact(
6174
type,

0 commit comments

Comments
 (0)