Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const repositoryFolderPath: string = resolvePath(__dirname, "..");
const packagesFolderPath: string = joinPath(repositoryFolderPath, "sdk");
const packageFolderPaths: string[] | undefined = getPackageFolderPaths(packagesFolderPath);
let exitCode: number = 0;
if (!packageFolderPaths) {
logger.logError(`The packages folder (${packagesFolderPath}) doesn't exist.`);
} else {
logger.logVerbose(`Found ${packageFolderPaths.length} package folders.`);
for (const packageFolderPath of packageFolderPaths) {
const packageFolderPathWithSep: string = normalize(packageFolderPath + path.posix.sep);
const shouldCheck = !!changedFiles && contains(changedFiles, (changedFilePath: string) => normalize(changedFilePath).startsWith(packageFolderPathWithSep));
if (shouldCheck) {
exitCode += checkEverything({
logger,
checkPackageJsonVersionOptions: {
startPath: packageFolderPath
},
checkForOnlyCallsOptions: {
startPaths: packageFolderPath
},
checkForSkipCallsOptions: {
startPaths: packageFolderPath
}
});
}
}
}
process.exitCode = exitCode;