rafaelcamargo/dollert

View on GitHub
setup-deploy.js

Summary

Maintainability
A
0 mins
Test Coverage
var fs = require('fs');
var exec = require('child_process').exec;

function init(){
  tryRemoveFile('./dist');
  tryRemoveFile('./dist.zip');
}

function tryRemoveFile(path){
  fs.access(path, fs.R_OK | fs.W_OK, (error) => {
    if(!error) {
      console.log(path + ' found. Removing it...');
      exec('rm -rf ' + path);
    }
  });
}

init();