UNPKG

nlu

Version:

Use this package to link your projects together for local development.

22 lines (21 loc) 740 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); const cp = require("child_process"); const logging_1 = require("./logging"); exports.cleanCache = function (cb) { const k = cp.spawn('bash', [], { env: Object.assign({}, process.env, { NPM_LINK_UP: 'yes' }) }); k.stdin.end('npm cache clean -f;'); k.stdout.setEncoding('utf8'); k.stderr.setEncoding('utf8'); k.stderr.pipe(process.stderr); k.once('error', function (e) { logging_1.default.error('npm cache clean/yarn cache clean experience spawn error =>\n', e.stack || e); }); k.once('exit', function (code) { code > 0 ? cb({ path: 'npm cache clean', code: code }) : cb(); }); };