Skip to content

Commit c5d7a94

Browse files
committed
In case when user executes some command and by some reasons user settings file is not a valid json, {N} CLI throws "Unexpected token in JSON at position 0" error. After that user is not able to execute any cli command until the file exists.
1 parent 8a6b640 commit c5d7a94

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/common

lib/services/user-settings-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import * as userSettingsServiceBaseLib from "../common/services/user-settings-se
44
class UserSettingsService extends userSettingsServiceBaseLib.UserSettingsServiceBase {
55
constructor($fs: IFileSystem,
66
$settingsService: ISettingsService,
7-
$lockfile: ILockFile) {
7+
$lockfile: ILockFile,
8+
$logger: ILogger) {
89
const userSettingsFilePath = path.join($settingsService.getProfileDir(), "user-settings.json");
9-
super(userSettingsFilePath, $fs, $lockfile);
10+
super(userSettingsFilePath, $fs, $lockfile, $logger);
1011
}
1112

1213
public async loadUserSettingsFile(): Promise<void> {

0 commit comments

Comments
 (0)