'use strict';

const tools = require('../../scripts/utils/tools');
const cleanUtils = require('../../scripts/utils/clean/clean-utils');
const configUtils = require('../../scripts/csdr/config/config-utils');

Promise.resolve()
  .then(() => {
    const pkg = configUtils.packages.getPackage();
    return cleanUtils.cleanPackage(pkg);
  })
  .then(() => {
    tools.logSuccess();
  })
  .catch((e) => {
    tools.logError('ERROR found while cleaning package');
    console.error(e);
    process.exit(1);
  })
