Skip to content

Commit c0b23ea

Browse files
committed
update: apply bash best practices - surround value in export key=value with "s and surround the entire return with newlines
1 parent 00d10fb commit c0b23ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

prisma.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,23 @@ rec {
116116
);
117117
/**
118118
This function converts attrset to bash export style.
119-
may or may not contain leading or trailing \n. do not assume their existence.
119+
return value contains leading and trailing newlines.
120120
121121
# Example
122122
```nix
123123
toExportStyle { foo = "bar"; baz = "abc"; }
124124
=>
125125
''
126-
export foo=bar
127-
export baz=abc
126+
export foo="bar"
127+
export baz="abc"
128128
''
129129
```
130130
131131
# Type
132132
toExportStyle :: Attrset<String> -> String
133133
*/
134134
toExportStyle =
135-
attrset: concatMapAttrsStringSep "\n" (name: value: "export ${name}=${value}") attrset;
135+
attrset: "\n" + (concatMapAttrsStringSep "\n" (name: value: "export ${name}=\"${value}\"") attrset) + "\n";
136136
in
137137
rec {
138138
package = nixpkgs.stdenv.mkDerivation {

0 commit comments

Comments
 (0)