MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / createCommand

Function createCommand

src/back/responses.ts:2756–2772  ·  view source on GitHub ↗
(filename: string, useWine: boolean, noshell: boolean)

Source from the content-addressed store, hash-verified

2754}
2755
2756function createCommand(filename: string, useWine: boolean, noshell: boolean): string {
2757 // This whole escaping thing is horribly broken. We probably want to switch
2758 // to an array representing the argv instead and not have a shell
2759 // in between.
2760 switch (process.platform) {
2761 case 'win32':
2762 return noshell ? filename : `"${filename}"`; // Quotes cause issues without a shell.
2763 case 'darwin':
2764 case 'linux':
2765 if (useWine) {
2766 return `wine start /wait /unix "${filename}"`;
2767 }
2768 return noshell ? filename : `"${filename}"`;
2769 default:
2770 throw Error('Unsupported platform');
2771 }
2772}
2773
2774/**
2775 * Run a command registered by an Extension

Callers 1

runGameServiceFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected