Skip to content

Commit 39be039

Browse files
chore(utils): refactors modify config helper
minor refactoring in the utils
1 parent 9f35073 commit 39be039

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

packages/utils/modify-config-helper.ts

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,26 @@ export default function modifyHelperUtil(
4848
if (action !== "init") {
4949
configPath = path.resolve(process.cwd(), configFile);
5050
const webpackConfigExists: boolean = fs.existsSync(configPath);
51+
let outputMessage =
52+
"\n" +
53+
logSymbols.error +
54+
chalk.red(" ERROR ") +
55+
chalk.cyan(configFile) +
56+
" not found. Please specify a valid path to your webpack config like \n " +
57+
chalk.white("$ ") +
58+
chalk.cyan(`webpack-cli ${action} webpack.dev.js`) +
59+
"\n";
5160
if (webpackConfigExists) {
52-
process.stdout.write(
61+
outputMessage =
5362
"\n" +
54-
logSymbols.success +
55-
chalk.green(" SUCCESS ") +
56-
"Found config " +
57-
chalk.cyan(configFile + "\n") +
58-
"\n"
59-
);
60-
} else {
61-
process.stdout.write(
62-
"\n" +
63-
logSymbols.error +
64-
chalk.red(" ERROR ") +
65-
chalk.cyan(configFile) +
66-
" not found. Please specify a valid path to your webpack config like \n " +
67-
chalk.white("$ ") +
68-
chalk.cyan(`webpack-cli ${action} webpack.dev.js`) +
69-
"\n"
70-
);
71-
return;
63+
logSymbols.success +
64+
chalk.green(" SUCCESS ") +
65+
"Found config " +
66+
chalk.cyan(configFile + "\n") +
67+
"\n";
7268
}
69+
process.stdout.write(outputMessage);
70+
return;
7371
}
7472

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

0 commit comments

Comments
 (0)