File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,22 +2,6 @@ const fs = require('fs-extra');
22const userHome = require ( 'user-home' ) ;
33const mkdirp = require ( 'mkdirp' ) ;
44
5- /**
6- * Check if a given folder exists before trying to access any of it's children
7- *
8- * @param {String } folder The folder we're checking
9- */
10- const folderExists = folder => {
11- let exists = false ;
12- fs . statSync ( folder , ( err , stats ) => {
13- if ( stats . isDirectory ( ) ) {
14- exists = true ;
15- }
16- } ) ;
17-
18- return exists ;
19- } ;
20-
215class Configuration {
226
237 /**
@@ -44,7 +28,7 @@ class Configuration {
4428 userConfigPath = `${ userHome } /Library/Preferences/Soundnode` ;
4529 }
4630
47- if ( ! folderExists ( userConfigPath ) ) {
31+ if ( ! fs . statSync ( userConfigPath ) . isDirectory ( ) ) {
4832 mkdirp ( userConfigPath , err => {
4933 if ( err ) {
5034 console . error ( err ) ;
@@ -84,4 +68,4 @@ class Configuration {
8468
8569}
8670
87- module . exports = Configuration ;
71+ module . exports = Configuration ;
You can’t perform that action at this time.
0 commit comments