Skip to content

Commit

Permalink
vscode: quote file variable
Browse files Browse the repository at this point in the history
Signed-off-by: Reputable2722 <[email protected]>
  • Loading branch information
Reputable2772 committed Feb 1, 2025
1 parent 355e80d commit bcb400f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/programs/vscode.nix
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ let
};
};
};
defaultProfile = (filterAttrs (n: v: n == "default") cfg.profiles).default;
allProfilesExceptDefault = (removeAttrs cfg.profiles [ "default" ]);
defaultProfile = if cfg.profiles ? default then cfg.profiles.default else { };
allProfilesExceptDefault = removeAttrs cfg.profiles [ "default" ];
in {
imports = [
(mkChangedOptionModule [ "programs" "vscode" "immutableExtensionsDir" ] [
Expand Down Expand Up @@ -297,7 +297,7 @@ in {
file="${userDir}/globalStorage/storage.json"
if [ -f "$file" ]; then
existing_profiles=$(jq '.userDataProfiles // [] | map({ (.name): .location }) | add // {}' $file)
existing_profiles=$(jq '.userDataProfiles // [] | map({ (.name): .location }) | add // {}' "$file")
file_write=""
profiles=(${
escapeShellArgs
Expand All @@ -314,12 +314,12 @@ in {
file_write="$file_write$([ "$file_write" != "" ] && echo "...")$profile"
done
echo "{}" > $file
echo "{}" > "$file"
fi
if [ "$file_write" != "" ]; then
userDataProfiles=$(jq ".userDataProfiles += $(echo $file_write | jq -R 'split("...") | map({ name: ., location: . })')" $file)
echo $userDataProfiles > $file
userDataProfiles=$(jq ".userDataProfiles += $(echo $file_write | jq -R 'split("...") | map({ name: ., location: . })')" "$file")
echo $userDataProfiles > "$file"
fi
'';
in modifyGlobalStorage.outPath);
Expand Down

0 comments on commit bcb400f

Please sign in to comment.