function () {
        var self = this;

        if (self.fileToDelete === null) {
            return;
        }

        fs.remove(self.fileToDelete, function (err) {
            if (err) {
                common.logging.error(new common.errors.GhostError({
                    err: err,
                    context: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.error'),
                    help: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.context')
                }));
            }

            self.fileToDelete = null;
        });
    }
function () {
        var self = this;

        if (self.fileToDelete === null) {
            return;
        }

        fs.remove(self.fileToDelete, function (err) {
            if (err) {
                common.logging.error(new common.errors.GhostError({
                    err: err,
                    context: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.error'),
                    help: common.i18n.t('errors.data.importer.index.couldNotCleanUpFile.context')
                }));
            }

            self.fileToDelete = null;
        });
    }
function ( ) { var self = this ; if ( self . fileToDelete === null ) { return ; } fs . remove ( self . fileToDelete , function ( err ) { if ( err ) { common . logging . error ( new common . errors . GhostError ( { err : err , context : common . i18n . t ( 'errors.data.importer.index.couldNotCleanUpFile.error' ) , help : common . i18n . t ( 'errors.data.importer.index.couldNotCleanUpFile.context' ) } ) ) ; } self . fileToDelete = null ; } ) ; }
Remove files after we're done (abstracted into a function for easier testing)
@returns {Function}
Remove files after we re done ( abstracted into a function for easier testing )
Delete the file