function _ensureAndJoinPath()

in common/scripts/install-run.js [380:395]


function _ensureAndJoinPath(baseFolder, ...pathSegments) {
    let joinedPath = baseFolder;
    try {
        for (let pathSegment of pathSegments) {
            pathSegment = pathSegment.replace(/[\\\/]/g, '+');
            joinedPath = path__WEBPACK_IMPORTED_MODULE_3__.join(joinedPath, pathSegment);
            if (!fs__WEBPACK_IMPORTED_MODULE_1__.existsSync(joinedPath)) {
                fs__WEBPACK_IMPORTED_MODULE_1__.mkdirSync(joinedPath);
            }
        }
    }
    catch (e) {
        throw new Error(`Error building local installation folder (${path__WEBPACK_IMPORTED_MODULE_3__.join(baseFolder, ...pathSegments)}): ${e}`);
    }
    return joinedPath;
}