Fix handling special chars in script paths
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.
This commit is contained in:
@@ -5,7 +5,6 @@ import { useAutoUnsubscribedEvents } from '@/presentation/components/Shared/Hook
|
||||
import { useClipboard } from '@/presentation/components/Shared/Hooks/Clipboard/UseClipboard';
|
||||
import { useCurrentCode } from '@/presentation/components/Shared/Hooks/UseCurrentCode';
|
||||
import { IApplicationContext } from '@/application/Context/IApplicationContext';
|
||||
import { RuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/RuntimeEnvironment';
|
||||
import {
|
||||
AnyLifetimeInjectionKey, InjectionKeySelector, InjectionKeys, SingletonKey,
|
||||
TransientKey, injectKey,
|
||||
@@ -14,6 +13,7 @@ import { PropertyKeys } from '@/TypeHelpers';
|
||||
import { useUserSelectionState } from '@/presentation/components/Shared/Hooks/UseUserSelectionState';
|
||||
import { useLogger } from '@/presentation/components/Shared/Hooks/UseLogger';
|
||||
import { useCodeRunner } from '@/presentation/components/Shared/Hooks/UseCodeRunner';
|
||||
import { HostRuntimeEnvironment } from '@/infrastructure/RuntimeEnvironment/HostRuntimeEnvironment';
|
||||
|
||||
export function provideDependencies(
|
||||
context: IApplicationContext,
|
||||
@@ -33,7 +33,7 @@ export function provideDependencies(
|
||||
),
|
||||
useRuntimeEnvironment: (di) => di.provide(
|
||||
InjectionKeys.useRuntimeEnvironment,
|
||||
RuntimeEnvironment.CurrentEnvironment,
|
||||
HostRuntimeEnvironment.CurrentEnvironment,
|
||||
),
|
||||
useAutoUnsubscribedEvents: (di) => di.provide(
|
||||
InjectionKeys.useAutoUnsubscribedEvents,
|
||||
|
||||
Reference in New Issue
Block a user