Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function ensureElectronConfig(projectPath: string) {
const outputPath = path.resolve(projectPath, 'electron-webpack.js');
if (!fs.pathExistsSync(outputPath)) {
fs.copy(path.resolve(__dirname, '../template/electron-webpack.js'), outputPath);
}
}
export async function ensureMinProjectSetupAsync(projectRoot: string): Promise {
ensureElectronConfig(projectRoot);
await ensureGitIgnoreAsync(projectRoot);
await ensureDependenciesAreInstalledAsync(projectRoot);
}
const generatedTag = `@generated: @expo/electron-adapter@${
require('@expo/electron-adapter/package.json').version
}`;
function createBashTag(): string {
return `# ${generatedTag}`;
}
export async function ensureGitIgnoreAsync(projectRoot: string): Promise {
const destinationPath = path.resolve(projectRoot, '.gitignore');
// Ensure a default expo .gitignore exists
if (!(await fs.pathExists(destinationPath))) {
return;
}
// Ensure the .gitignore has the required fields
let contents = await fs.readFile(destinationPath, 'utf8');
module.exports = config => {
return withExpoWebpack(config);
};