@@ -164,7 +164,7 @@ buildCliConfig()
164
164
process . exit ( 1 )
165
165
} )
166
166
167
- function rc ( ctx , path ) {
167
+ function rc ( ctx , path , cliConfigPath ) {
168
168
if ( argv . use ) return Promise . resolve ( cliConfig )
169
169
170
170
return postcssrc ( ctx , path )
@@ -178,7 +178,7 @@ function rc(ctx, path) {
178
178
return rc
179
179
} )
180
180
. catch ( ( err ) => {
181
- if ( ! err . message . includes ( 'No PostCSS Config found' ) ) throw err
181
+ if ( ! err . message . includes ( 'No PostCSS Config found' ) || cliConfigPath ) throw err
182
182
} )
183
183
}
184
184
@@ -202,6 +202,8 @@ function files(files) {
202
202
function css ( css , file ) {
203
203
const ctx = { options : cliConfig . options }
204
204
205
+ const origArgvConfig = argv . config
206
+
205
207
if ( file !== 'stdin' ) {
206
208
ctx . file = {
207
209
dirname : path . dirname ( file ) ,
@@ -221,7 +223,7 @@ function css(css, file) {
221
223
222
224
printVerbose ( pc . cyan ( `Processing ${ pc . bold ( relativePath ) } ...` ) )
223
225
224
- return rc ( ctx , argv . config )
226
+ return rc ( ctx , argv . config , origArgvConfig )
225
227
. then ( ( config ) => {
226
228
config = config || cliConfig
227
229
const options = { ...config . options }
0 commit comments