Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
generateYoctoConfig(folder: string) {
const filePath = path.join(folder, LocalConstants.configFileName);
if (!fs.existsSync(filePath)) {
const config:
RaspberryPiYoctoConfig = {output: LocalConstants.defaultOutputPath};
fs.writeFileSync(filePath, JSON.stringify(config, null, 4));
}
}
}
async load(): Promise {
const deviceFolderPath = this.deviceFolder;
if (!fs.existsSync(deviceFolderPath)) {
throw new Error('Unable to find the device folder inside the project.');
}
if (!fs.existsSync(path.join(deviceFolderPath, 'node_modules'))) {
cp.exec('npm install', {cwd: deviceFolderPath});
}
return true;
}