const fs = require('fs')
const util = require('util')

function fileExist(filename = '') {
  try {
    fs.accessSync(filename)
  } catch (e) {
    return false
  }

  return true
}

module.exports = exports = {
  fileExist,
  writeFile: util.promisify(fs.writeFile),
  readFile: util.promisify(fs.readFile),
  chmod: util.promisify(fs.chmod)
}

@@ -46,16 +46,85 @@
 ('util')
+%0Aconst path = require('path')%0A%0Aconst %7B log %7D = require('./log.utils')
 %0A%0Afuncti
@@ -244,16 +244,638 @@
 true%0A%7D%0A%0A
+function mkdirp(pathname = '') %7B%0A  const pathParts = pathname.split('/')%0A  const mkdir = util.promisify(fs.mkdir)%0A%0A  return pathParts.reduce((promise, part) =%3E %7B%0A    return promise%0A      .then((previousPath) =%3E %7B%0A        const newPath = path.join(previousPath, part)%0A        %0A        if (fileExist(newPath)) %7B%0A          return newPath%0A        %7D%0A%0A        return mkdir(newPath)%0A          .catch(error =%3E %7B%0A            if (error.code !== 'EEXIST') %7B%0A              throw new Error('dir_create_failed')%0A            %7D%0A          %7D)%0A          .then(() =%3E newPath)%0A      %7D)%0A  %7D, Promise.resolve(pathname%5B0%5D === '/' ? '/' : ''))%0A%7D%0A%0A
 module.e
@@ -992,16 +992,16 @@
 dFile),%0A
-
   chmod:
@@ -1025,11 +1025,95 @@
 s.chmod)
+,%0A  mkdir: util.promisify(fs.mkdir),%0A  symlink: util.promisify(fs.symlink),%0A  mkdirp
 %0A%7D%0A

Add symlink and mkdir