mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
24 lines
619 B
JavaScript
24 lines
619 B
JavaScript
|
const fs = require('fs');
|
||
|
|
||
|
let fillContent = '';
|
||
|
|
||
|
// if (!process.argv.includes('--electron')) {
|
||
|
if (process.platform == 'win32') {
|
||
|
fillContent += `content.msnodesqlv8 = () => require('msnodesqlv8');`;
|
||
|
}
|
||
|
|
||
|
const getContent = (empty) => `
|
||
|
// this file is generated automatically by script fillNativeModules.js, do not edit it manually
|
||
|
const content = {};
|
||
|
|
||
|
${empty ? '' : fillContent}
|
||
|
|
||
|
module.exports = content;
|
||
|
`;
|
||
|
|
||
|
fs.writeFileSync(
|
||
|
'packages/api/src/nativeModulesContent.js',
|
||
|
getContent(process.argv.includes('--electron') ? true : false)
|
||
|
);
|
||
|
fs.writeFileSync('app/src/nativeModulesContent.js', getContent(false));
|