MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / toCommandArgument

Function toCommandArgument

src/platform/common/helpers.ts:29–34  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

27 * @param {String} value.
28 */
29export function toCommandArgument(value: string): string {
30 if (!value) {
31 return value;
32 }
33 return value.indexOf(' ') >= 0 && !value.startsWith('"') && !value.endsWith('"') ? `"${value}"` : value.toString();
34}
35
36/**
37 * Appropriately formats a a file path so it can be used as an argument for a command in a shell.

Callers 4

getExecutionArgsMethod · 0.90
logProcessFunction · 0.90
fileToCommandArgumentFunction · 0.85

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected