Skip to content

Commit

Permalink
Fix script and ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
mrruby committed Jan 30, 2024
1 parent 4809064 commit 7da4f90
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion holo-key-manager-js-client/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ node_modules/
src/
types/
prebuild.cjs
index.ts
index.ts
*.tgz

15 changes: 13 additions & 2 deletions holo-key-manager-js-client/prebuild.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}',
Expand All @@ -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());

0 comments on commit 7da4f90

Please sign in to comment.