Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SkillfulElectro authored Jun 12, 2024
1 parent 39cd1ea commit 0e6a4f4
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,20 @@ const customPartition = `my-session-${currentTime}`;
var custtomSession

function loadConfig(configPath) {
try {
const configContents = fs.readFileSync(configPath, 'utf8');
const configOptions = JSON.parse(configContents);

if (fs.existsSync(configPath)){
if (fs.statSync(configPath).isDirectory()) {
configPath = path.join(configPath, 'MUTEXIS_KIT.json');
}

try {
const configContents = fs.readFileSync(configPath, 'utf8');
const configOptions = JSON.parse(configContents);
// Merge default options with the ones from the config file
Object.assign(options, configOptions);
} catch (error) {
console.error('Error loading config file:', error);
Object.assign(options, configOptions);
} catch (error) {
console.error('Error loading config file:', error);
}
}
}

Expand Down

0 comments on commit 0e6a4f4

Please sign in to comment.