Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore(utils): refactors modify config helper
minor refactoring in the utils
  • Loading branch information
pranshuchittora committed Jun 4, 2019
1 parent 9f35073 commit 39be039
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions packages/utils/modify-config-helper.ts
Expand Up @@ -48,28 +48,26 @@ export default function modifyHelperUtil(
if (action !== "init") {
configPath = path.resolve(process.cwd(), configFile);
const webpackConfigExists: boolean = fs.existsSync(configPath);
let outputMessage =
"\n" +
logSymbols.error +
chalk.red(" ERROR ") +
chalk.cyan(configFile) +
" not found. Please specify a valid path to your webpack config like \n " +
chalk.white("$ ") +
chalk.cyan(`webpack-cli ${action} webpack.dev.js`) +
"\n";
if (webpackConfigExists) {
process.stdout.write(
outputMessage =
"\n" +
logSymbols.success +
chalk.green(" SUCCESS ") +
"Found config " +
chalk.cyan(configFile + "\n") +
"\n"
);
} else {
process.stdout.write(
"\n" +
logSymbols.error +
chalk.red(" ERROR ") +
chalk.cyan(configFile) +
" not found. Please specify a valid path to your webpack config like \n " +
chalk.white("$ ") +
chalk.cyan(`webpack-cli ${action} webpack.dev.js`) +
"\n"
);
return;
logSymbols.success +
chalk.green(" SUCCESS ") +
"Found config " +
chalk.cyan(configFile + "\n") +
"\n";
}
process.stdout.write(outputMessage);
return;
}

const env = yeoman.createEnv("webpack", null);
Expand Down

0 comments on commit 39be039

Please sign in to comment.