文件操作 - clean.js
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/atom/resources/app/apm/lib/clean.js
编辑文件内容
(function() { var CSON, Clean, Command, _, async, config, fs, path, yargs; path = require('path'); async = require('async'); CSON = require('season'); yargs = require('yargs'); _ = require('underscore-plus'); Command = require('./command'); config = require('./apm'); fs = require('./fs'); module.exports = Clean = (function() { class Clean extends Command { constructor() { super(); this.atomNpmPath = require.resolve('npm/bin/npm-cli'); } parseOptions(argv) { var options; options = yargs(argv).wrap(Math.min(100, yargs.terminalWidth())); options.usage("Usage: apm clean\n\nDeletes all packages in the node_modules folder that are not referenced\nas a dependency in the package.json file."); return options.alias('h', 'help').describe('help', 'Print this usage message'); } run(options) { process.stdout.write("Removing extraneous modules "); return this.fork(this.atomNpmPath, ['prune'], (...args) => { return this.logCommandResults(options.callback, ...args); }); } }; Clean.commandNames = ['clean', 'prune']; return Clean; }).call(this); }).call(this);
修改文件时间
将文件时间修改为当前时间的前一年
删除文件