diff --git a/holo-key-manager-js-client/.npmignore b/holo-key-manager-js-client/.npmignore index 217ccfb..fac3fe7 100644 --- a/holo-key-manager-js-client/.npmignore +++ b/holo-key-manager-js-client/.npmignore @@ -3,4 +3,6 @@ node_modules/ src/ types/ prebuild.cjs -index.ts \ No newline at end of file +index.ts +*.tgz + diff --git a/holo-key-manager-js-client/prebuild.cjs b/holo-key-manager-js-client/prebuild.cjs index d0068c1..3f40d61 100644 --- a/holo-key-manager-js-client/prebuild.cjs +++ b/holo-key-manager-js-client/prebuild.cjs @@ -5,7 +5,7 @@ require('dotenv').config({ path: '../.env' }); const fs = require('fs'); const path = require('path'); -const configContent = ` +const generateConfigContent = () => ` export const browserConfig = { ChromeID: '${process.env.CHROME_ID}', FirefoxID: '${process.env.FF_ID}', @@ -14,4 +14,15 @@ export const browserConfig = { `; const configFile = path.resolve(__dirname, 'src', 'browserConfig.ts'); -fs.writeFileSync(configFile, configContent, 'utf8'); + +const writeConfigFile = (filePath, content) => { + if (fs.existsSync(filePath)) { + console.log('browserConfig exists, overriding...'); + } + fs.writeFile(filePath, content, 'utf8', (err) => { + if (err) throw err; + console.log('browserConfig.ts has been saved!'); + }); +}; + +writeConfigFile(configFile, generateConfigContent());