Skip to content

Commit ce8bd83

Browse files
committed
Fix: Working on windows
1 parent 270f295 commit ce8bd83

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

bin/helpers/readCypressConfigUtil.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,8 @@ function generateTscCommandAndTempTsConfig(bsConfig, bstack_node_modules_path, c
3737
if (tsConfigFilePath && fs.existsSync(tsConfigFilePath) && path.extname(tsConfigFilePath).toLowerCase() === '.json') {
3838
const tsConfig = JSON.parse(fs.readFileSync(tsConfigFilePath, 'utf8'));
3939
if (tsConfig.compilerOptions) {
40-
if (tsConfig.compilerOptions.baseUrl) {
41-
// Use the directory containing the original tsconfig as baseUrl
42-
tempTsConfig.compilerOptions.baseUrl = path.dirname(tsConfigFilePath);
43-
} else {
44-
logger.warn(`tsconfig at ${tsConfigFilePath} does not define baseUrl, defaulting to "."`);
45-
}
4640
if (tsConfig.compilerOptions.paths) {
41+
tempTsConfig.compilerOptions.baseUrl = path.dirname(path.resolve(tsConfigFilePath));
4742
tempTsConfig.compilerOptions.paths = tsConfig.compilerOptions.paths;
4843
}
4944
}
@@ -92,6 +87,7 @@ exports.convertTsConfig = (bsConfig, cypress_config_filepath, bstack_node_module
9287
try {
9388
logger.debug(`Running: ${tscCommand}`)
9489
tsc_output = cp.execSync(tscCommand, { cwd: working_dir })
90+
cp.execSync(tscCommand, { cwd: working_dir })
9591
} catch (err) {
9692
// error while compiling ts files
9793
logger.debug(err.message);
@@ -103,7 +99,7 @@ exports.convertTsConfig = (bsConfig, cypress_config_filepath, bstack_node_module
10399

104100
// Clean up the temporary tsconfig file
105101
if (fs.existsSync(tempTsConfigPath)) {
106-
// fs.unlinkSync(tempTsConfigPath);
102+
fs.unlinkSync(tempTsConfigPath);
107103
logger.info(`Temporary tsconfig file removed: ${tempTsConfigPath}`);
108104
}
109105

@@ -178,4 +174,4 @@ exports.readCypressConfigFile = (bsConfig) => {
178174
fs.rmdirSync(complied_js_dir, { recursive: true })
179175
}
180176
}
181-
}
177+
}

0 commit comments

Comments
 (0)