Skip to content

Commit 3fb3385

Browse files
d4mationclaude
andcommitted
ENG-219: Check for invalid .puprc during app initialization
Matches the PHP behavior where invalid .puprc is reported before any command runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 12df110 commit 3fb3385

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/app.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Command } from 'commander';
22
import { Config, getConfig, resetConfig } from './config.js';
3+
import * as output from './utils/output.js';
34
import { fileURLToPath } from 'node:url';
45
import path from 'node:path';
56
import fs from 'fs-extra';
@@ -43,6 +44,12 @@ export const PUP_VERSION = getVersion();
4344
export function createApp(): Command {
4445
resetConfig();
4546

47+
const config = getConfig();
48+
if (config.hasInvalidPuprc()) {
49+
output.error('There is a .puprc file in this directory, but it could not be parsed.');
50+
output.error(`JSON Error: ${config.getPuprcParseError()}`);
51+
}
52+
4653
const program = new Command();
4754
program
4855
.name('pup')

0 commit comments

Comments
 (0)