function updateReadme(callback) { shell.rm('-rf', shell.find(`${helper.config.appDir}README.md`)); helper.updateReadme(projectName, () => { callback(); }); }
async deleteThemeStaticForder(app, tempAlias) { let temp_static_forder = app.config.temp_static_forder; var tempPath = app.config.temp_view_forder + tempAlias; var tempStaticPath = temp_static_forder + tempAlias; var tempAssetsPath = path.join(app.config.baseDir, `app/assets/${tempAlias}`); shell.rm('-rf', tempPath); shell.rm('-rf', tempStaticPath); shell.rm('-rf', tempAssetsPath); }
targetBuildModules.forEach(function (name) { if (name != '.git' && name != 'build' && name != 'publicMethods' && name != 'dist') { shell.cd(`${modulesPath}/${name}`); shell.exec(`${envSetStr} NODE_ENV=production && npm run build`); if (!fs.existsSync(`${modulesPath}/dist/${name}`)) { shell.mkdir('-p', `${modulesPath}/dist/${name}`); } else { shell.rm('-rf', `${modulesPath}/dist/${name}/*`); } shell.cp('-R', `${modulesPath}/${name}/dist/*`, `${modulesPath}/dist/${name}`); console.info(`module ${name} build success!`); } });
/** * Deletes the .git folder in dir */ function cleanRepo(callback) { shell.rm('-rf', '.git/'); callback(); }
function cleanSetup(callback) { if (!isCleanSetup) return callback(); const comps = shell .find(helper.config.componentsDir) .filter( (file, index) => index !== 0 && !file.toLowerCase().includes('appicons') && !file.toLowerCase().includes('authfields') && !file.toLowerCase().includes('app.js') && !file.toLowerCase().includes('theme.js') ); shell.rm('-rf', comps); const pages = shell .find(helper.config.pagesDir) .filter( (file, index) => index !== 0 && !file.toLowerCase().includes('_document.js') ); shell.rm('-rf', pages); helper.createPageFromTemplate('index', () => {}); helper.createContainerFromTemplate('Default', () => {}); helper.clearRoutes(() => { callback(); }); }
/** * Deletes the file provided it exists * @param {string} file Relative or absolute path to file */ deleteIfExists(file) { if (!fs.existsSync(file)) { echo.message(`File '${file}' does not exist. Nothing to delete.`); return; } shell.rm("-f", file); echo.success(`File '${file}' successfully deleted`); }
// eslint-disable-next-line no-undef beforeAll(() => { Shell.rm('-rf', tmpBase); Shell.mkdir('-p', tmpDir); Shell.cp('-r', Path.resolve(__dirname, 'fixtures/app'), tmpDir); Shell.cd(appDir); });
it('checking the created directory', function () { const fixtureDirectoryProvider = dfp(fixturesRoot)() shell.rm('-rf', fixtureDirectoryProvider.tmpSubFolder) let fixtureData = fixtureDirectoryProvider.get('./') if (!isDirectory.sync(fixtureData.dir)) { throw String('Something is terribly worng!') } })
end() { this.log(); this.log(`Installing ${chalk.cyan('libdefs...')}`); this.log(); shell.exec('npm start flow.typed', { silent: true }); this.log(chalk.cyan(`Thanks for using generator-bunny, ${this.tpl.name}!`)); this.log(); shell.rm('.yo-rc.json'); shell.exec('git add -A', { silent: true }); shell.exec('git commit -qnm "chore: initial commit"', { silent: true, }); }
cleanUpProject () { this.server && this.server.cleanUp(); if (this.config.shouldCleanUpAfterRun()) { logger.info('cordova-paramedic: Deleting the application: ' + this.tempFolder.name); shell.popd(); shell.rm('-rf', this.tempFolder.name); } }
targets.map((pathToTarget, index) => { const segments = pathToTarget.split(path.sep); const pathToMinified = path.join(segments.slice(0, segments.length - 1).join(path.sep), 'static', segments[segments.length - 1]); shell.exec(`$(npm bin)/minify ${pathToTarget} --out-file ${pathToMinified}`, (code, stdout, stderr) => { console.log(`minified: ${pathToMinified}`); shell.rm('-f', pathToTarget); if (index === targets.length - 1) { process.exit(code); } }); });
/** * Safely and recursively removes directories matching the provided name. Skips '.git' and * 'node_modules' directories. * * @param {string} dir */ const _recursiveRm = (dir) => { echo.message(`Recursively deleting '${dir}' directories...`); const directories = _getMatchingPaths(dir); if (CollectionUtils.isEmpty(directories)) { echo.message( `No '${dir}' directories found - skipping this clean step.` ); return; } const { code } = shell.rm("-rf", directories); if (code !== 0) { echo.error(`Failed to delete '${dir}' directories: ${code}`); shell.exit(code); } echo.success(`'${dir}' directories deleted successfully!`); }
// eslint-disable-next-line no-undef afterAll(() => { Shell.rm('-rf', tmpBase); });
run() { echo.message( `Recursively deleting '${NODE_MODULES_DIR}' directory in ${shell.pwd()}...` ); shell.rm("-rf", NODE_MODULES_DIR); echo.success(`'${NODE_MODULES_DIR}' directory deleted successfully!`); }
/** * Deletes the directory provided it exists * @param {string} dir Relative or absolute path to directory */ deleteIfExists(dir) { if (!fs.existsSync(dir)) { echo.message( `Directory '${dir}' does not exist. Nothing to delete.` ); return; } shell.rm("-rf", dir); echo.success(`Directory '${dir}' successfully deleted`); }