Skip to content

Commit 7f1725b

Browse files
committed
1 parent 4c5a69c commit 7f1725b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ buildCliConfig()
164164
process.exit(1)
165165
})
166166

167-
function rc(ctx, path) {
167+
function rc(ctx, path, cliConfigPath) {
168168
if (argv.use) return Promise.resolve(cliConfig)
169169

170170
return postcssrc(ctx, path)
@@ -178,7 +178,7 @@ function rc(ctx, path) {
178178
return rc
179179
})
180180
.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
182182
})
183183
}
184184

@@ -202,6 +202,8 @@ function files(files) {
202202
function css(css, file) {
203203
const ctx = { options: cliConfig.options }
204204

205+
const origArgvConfig = argv.config
206+
205207
if (file !== 'stdin') {
206208
ctx.file = {
207209
dirname: path.dirname(file),
@@ -221,7 +223,7 @@ function css(css, file) {
221223

222224
printVerbose(pc.cyan(`Processing ${pc.bold(relativePath)}...`))
223225

224-
return rc(ctx, argv.config)
226+
return rc(ctx, argv.config, origArgvConfig)
225227
.then((config) => {
226228
config = config || cliConfig
227229
const options = { ...config.options }

0 commit comments

Comments
 (0)