This repository was archived by the owner on Jul 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -110,10 +110,14 @@ export async function runCli(
110110
111111 // if we ever need to add more language special cases here (beyond yaml files), this should be generalized into an array
112112 const formatCommand = `prettier ${ defaultFiles } --config "${ configFiles . prettierDefault . copyToPath } " ${ prettierFlags } && prettier ${ yamlFiles } --config "${ configFiles . prettierYaml . copyToPath } " ${ prettierFlags } ` ;
113- await runShellCommand ( interpolationSafeWindowsPath ( formatCommand ) , {
113+ const prettierResult = await runShellCommand ( interpolationSafeWindowsPath ( formatCommand ) , {
114114 cwd,
115115 hookUpToConsole : shouldLog ,
116116 } ) ;
117+ if ( prettierResult . exitCode !== 0 ) {
118+ // no need to include anything in the error, hookUpToConsole above will handle all error logging.
119+ throw new Error ( ) ;
120+ }
117121 } else {
118122 const errors : Error [ ] = [ ] ;
119123 await awaitedForEach ( getObjectTypedKeys ( configFiles ) , async ( configFileName ) => {
@@ -145,7 +149,6 @@ if (require.main === module) {
145149 const { command, args} = getCommands ( ) ;
146150
147151 runCli ( process . cwd ( ) , command , args , true ) . catch ( ( error ) => {
148- console . error ( error ) ;
149152 process . exit ( 1 ) ;
150153 } ) ;
151154}
You can’t perform that action at this time.
0 commit comments