// SPDX-License-Identifier: Apache-2.0
import path from 'node:path';
export class ExecutionBuilder {
    prefixPath(environment, prefix) {
        // find the PATH variable in the environment variables, ignoring case sensitivity, POSIX is PATH, Windows is Path or PATH
        const pathKey = Object.keys(environment).find((key) => key.toLowerCase() === 'path');
        if (pathKey) {
            environment[pathKey] = `${prefix}${path.delimiter}${environment[pathKey]}`;
        }
        else {
            environment['PATH'] = prefix || '';
        }
    }
}
//# sourceMappingURL=execution-builder.js.map