Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc1183af

Browse files
authored
fix: optionally write to settings (#123)
1 parent8193a11 commitc1183af

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎src/remote.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,13 @@ export class Remote {
277277
constparsed=jsonc.parse(settingsContent)
278278
parsed["remote.SSH.remotePlatform"]=remotePlatforms
279279
constedits=jsonc.modify(settingsContent,["remote.SSH.remotePlatform"],remotePlatforms,{})
280-
awaitfs.writeFile(this.storage.getUserSettingsPath(),jsonc.applyEdits(settingsContent,edits))
280+
try{
281+
awaitfs.writeFile(this.storage.getUserSettingsPath(),jsonc.applyEdits(settingsContent,edits))
282+
}catch(ex){
283+
// The user will just be prompted instead, which is fine!
284+
// If a user's settings.json is read-only, then we can't write to it.
285+
// This is the case when using home-manager on NixOS.
286+
}
281287

282288
constworkspaceUpdate=newvscode.EventEmitter<Workspace>()
283289
constwatchURL=newURL(`${this.storage.getURL()}/api/v2/workspaces/${this.storage.workspace.id}/watch`)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp