lib/utils/file_utils.js
function createDirectory(directory) {
  if (!directory) {
    throw new Error('A directory must be passed to be created.');
  }
  const statObject = getStatObject(directory);
  if (statObject && statObject.isFile()) {
    throw new Error(`The directory to create '${directory}' is a file.`);
  }
  fse.ensureDirSync(directory);
}
function createDirectory(directory) {
  if (!directory) {
    throw new Error('A directory must be passed to be created.');
  }
  const statObject = getStatObject(directory);
  if (statObject && statObject.isFile()) {
    throw new Error(`The directory to create '${directory}' is a file.`);
  }
  fse.ensureDirSync(directory);
}
function createDirectory ( directory ) { if ( ! directory ) { throw new Error ( 'A directory must be passed to be created.' ) ; } const statObject = getStatObject ( directory ) ; if ( statObject && statObject . isFile ( ) ) { throw new Error ( ` ${ directory } ` ) ; } fse . ensureDirSync ( directory ) ; }
Creates a directory, if it doesn't exist already.
@param directory the directory to create.
@throws WrongDirException if the directory to create exists and is a file.
Creates a directory if it doesn t exist already .