This commit improves the handling of paths with spaces or special characters during script execution in the desktop application. Key improvements: - Paths are now quoted for macOS/Linux, addressing issues with whitespace or single quotes. - Windows paths are enclosed in double quotes to handle special characters. Other supporting changes: - Add more documentation for terminal execution commands. - Refactor terminal script file execution into a dedicated file for improved separation of concerns. - Refactor naming of `RuntimeEnvironment` to align with naming conventions (no interface with I prefix) and for clarity. - Refactor `TemporaryFileCodeRunner` to simplify it by removing the `os` parameter and handling OS-specific logic within the filename generator instead. - Refactor `fileName` to `filename` for consistency.
15 lines
451 B
TypeScript
15 lines
451 B
TypeScript
import { CommandOps } from '@/infrastructure/CodeRunner/SystemOperations/SystemOperations';
|
|
import { StubWithObservableMethodCalls } from './StubWithObservableMethodCalls';
|
|
|
|
export class CommandOpsStub
|
|
extends StubWithObservableMethodCalls<CommandOps>
|
|
implements CommandOps {
|
|
public exec(command: string): Promise<void> {
|
|
this.registerMethodCall({
|
|
methodName: 'exec',
|
|
args: [command],
|
|
});
|
|
return Promise.resolve();
|
|
}
|
|
}
|