Skip to content

Commit

Permalink
Simplify mkdirSync call
Browse files Browse the repository at this point in the history
  • Loading branch information
nsakaimbo committed Mar 26, 2020
1 parent 717944e commit 8e6a540
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions desktop/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@ const appData = path.join( app.getPath( 'appData' ), config.appPathName );

// Initialize log directory prior to requiring any modules that log
const logPath = process.env.WP_DEBUG_LOG ? process.env.WP_DEBUG_LOG : path.join( appData, 'logs', 'wp-desktop.log' );
try {
return mkdirSync( path.dirname( logPath ), { recursive: true } )
} catch ( err ) {
if ( err.code !== 'EEXIST' ) {
err.message = 'Failed to initialize log directory: ' + err.message;
throw err;
}
}
mkdirSync( path.dirname( logPath ), { recursive: true } )
state.setLogPath( logPath );

// Initialize settings
Expand Down

0 comments on commit 8e6a540

Please sign in to comment.