| 2754 | } |
| 2755 | |
| 2756 | function 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 |