Hans 28925dc3a6 chore(install): move ember cli in our repo and remove everything unnecessary (#3056)
* chore(install): move ember-cli to a directory in angular-cli
* further remove files
2016-11-10 02:34:23 +01:00

26 lines
528 B
JavaScript

'use strict';
var fs = require('fs-extra');
var existsSync = require('exists-sync');
var Promise = require('angular-cli/ember-cli/lib/ext/promise');
var remove = Promise.denodeify(fs.remove);
var root = process.cwd();
module.exports.setup = function (path) {
process.chdir(root);
return remove(path).then(function () {
fs.mkdirsSync(path);
});
};
module.exports.teardown = function (path) {
process.chdir(root);
if (existsSync(path)) {
return remove(path);
} else {
return Promise.resolve();
}
};