src/indexOld.js
function removeMachine(name) {
        return co(function*(){
            debug("Removing the machine");
            let manifest = getManifest();

            if(!manifest.machines[name]) {
                debug("Machine doesn't exists");
                return;
            }

            let machinePath = machinesDirPath + "/" + name;
            let removedFileNames = _getFiles(machinePath).map((f)=>f.substring(repositoryPath.length + 1));

            delete manifest.machines[name];
            yield new Promise(function(resolve, reject) {
                rimraf(machinesDirPath + "/" + name, function () {
                    resolve();
                });
            }).then();

            debug("Setting the manifest");
            setManifest(manifest);

            yield _commit(null, ["manifest.json"], "Removed '" +  name + "' machine.", removedFileNames);

            return Object.keys(manifest.machines);

        });
    }
function removeMachine(name) {
        return co(function*(){
            debug("Removing the machine");
            let manifest = getManifest();

            if(!manifest.machines[name]) {
                debug("Machine doesn't exists");
                return;
            }

            let machinePath = machinesDirPath + "/" + name;
            let removedFileNames = _getFiles(machinePath).map((f)=>f.substring(repositoryPath.length + 1));

            delete manifest.machines[name];
            yield new Promise(function(resolve, reject) {
                rimraf(machinesDirPath + "/" + name, function () {
                    resolve();
                });
            }).then();

            debug("Setting the manifest");
            setManifest(manifest);

            yield _commit(null, ["manifest.json"], "Removed '" +  name + "' machine.", removedFileNames);

            return Object.keys(manifest.machines);

        });
    }
function removeMachine ( name ) { return co ( function * ( ) { debug ( "Removing the machine" ) ; let manifest = getManifest ( ) ; if ( ! manifest . machines [ name ] ) { debug ( "Machine doesn't exists" ) ; return ; } let machinePath = machinesDirPath + "/" + name ; let removedFileNames = _getFiles ( machinePath ) . map ( ( f ) => f . substring ( repositoryPath . length + 1 ) ) ; delete manifest . machines [ name ] ; yield new Promise ( function ( resolve , reject ) { rimraf ( machinesDirPath + "/" + name , function ( ) { resolve ( ) ; } ) ; } ) . then ( ) ; debug ( "Setting the manifest" ) ; setManifest ( manifest ) ; yield _commit ( null , [ "manifest.json" ] , "Removed '" + name + "' machine." , removedFileNames ) ; return Object . keys ( manifest . machines ) ; } ) ; }
Remove a machine from the repository
@method removeMachine
@param {String} name The name of the machine
@returns {Promise}
Remove a machine from the repository