"use strict";
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
Object.defineProperty(exports, "__esModule", { value: true });
exports.IS_WINDOWS = void 0;
exports.escapeArgumentIfNeeded = escapeArgumentIfNeeded;
exports.IS_WINDOWS = process.platform === 'win32';
function escapeArgumentIfNeeded(command, isWindows = exports.IS_WINDOWS) {
    if (command.includes(' ')) {
        if (isWindows) {
            // Windows: use double quotes and escape internal double quotes
            return `"${command.replace(/"/g, '""')}"`;
        }
        else {
            // Unix: use JSON.stringify for proper escaping
            return JSON.stringify(command);
        }
    }
    else {
        return command;
    }
}
//# sourceMappingURL=executionUtilities.js.map