function updateReadme(callback) { shell.rm('-rf', shell.find(`${helper.config.appDir}README.md`)); helper.updateReadme(projectName, () => { 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(); }); }
findCsprojFiles() { const solutionDir = dotnetPath.solutionDir(); echo.message("Looking for csproj files under the current directory..."); const findResult = shell.find(`${solutionDir}/**/*.csproj`); if (findResult.code !== 0) { echo.error(constants.ERROR_READING_CSPROJ_FILES); shell.exit(findResult.code); } return findResult; }
// #endregion Imports // ----------------------------------------------------------------------------------------- // #region Private Functions // ----------------------------------------------------------------------------------------- /** * Returns files/directories under the current working directory matching the given name. * Skips '.git' and 'node_modules' directories. * * @param {string} dir * @returns */ const _getMatchingPaths = (dir) => shell.find(".").filter((path) => { if (path.startsWith(".git")) { return false; } // If sln is on the root of repo, we must avoid cleaning .git if (path.includes("node_modules")) { return false; } // Disregard any in node_modules directories return path.match(dir); })
dir.pushd(solutionDir); const testProjects = shell.find("**/*.Test*.csproj"); if (CollectionUtils.isEmpty(testProjects)) { echo.error(