From: Johannes Schindelin via GitGitGadget Date: Mon, 30 Jul 2018 15:42:52 GMT Subject: [PATCH v2 5/9] vscode: only overwrite C/C++ settings Message-ID: <3dd53c04c4e10d0ec8ce2e6b04558824ab61eb67.1532965363.git.gitgitgadget@gmail.com> In-Reply-To: From: Johannes Schindelin The C/C++ settings are special, as they are the only generated VS Code configurations that *will* change over the course of Git's development, e.g. when a new constant is defined. Therefore, let's only update the C/C++ settings, also to prevent user modifications from being overwritten. Ideally, we would keep user modifications in the C/C++ settings, but that would require parsing JSON, a task for which a Unix shell script is distinctly unsuited. So we write out .new files instead, and warn the user if they may want to reconcile their changes. Signed-off-by: Johannes Schindelin --- contrib/vscode/init.sh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/contrib/vscode/init.sh b/contrib/vscode/init.sh index 494a51ac5..ba9469226 100755 --- a/contrib/vscode/init.sh +++ b/contrib/vscode/init.sh @@ -13,7 +13,7 @@ die "Could not create .vscode/" # General settings -cat >.vscode/settings.json <<\EOF || +cat >.vscode/settings.json.new <<\EOF || { "C_Cpp.intelliSenseEngine": "Default", "C_Cpp.intelliSenseEngineFallback": "Disabled", @@ -51,7 +51,7 @@ esac # Default build task -cat >.vscode/tasks.json <.vscode/tasks.json.new <.vscode/launch.json <.vscode/launch.json.new <