Commit 0118cbe
authored
[nix] Don't add bad package to devbox.json (#525)
## Summary
If we get any error while trying to add packages we revert devbox.json
and show error.
## How was it tested?
Tried to add a broken package and made sure it did not get added to
devbox.json
```bash
devbox add php81Extensions.blackfire
Installing nix packages.
error: attribute 'extensionName' missing
at /nix/store/j5a7i3dvxslg2ychfy53wdhg1m3xfrwm-source/pkgs/development/interpreters/php/generic.nix:94:29:
93|
94| getExtName = ext: ext.extensionName;
| ^
95|
(use '--show-trace' to show detailed location information)
There was an error installing nix packages: php81Extensions.blackfire. Packages were not added to devbox.json
Error: apply Nix derivation: running command /nix/var/nix/profiles/default/bin/nix-env --profile /Users/mike/dev/scratch/php/.devbox/nix/profile/default --install -f /Users/mike/dev/scratch/php/.devbox/gen/development.nix: exit status 1 with command stderr:
```1 parent fa4aa27 commit 0118cbe
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
135 | 148 | | |
136 | 149 | | |
137 | 150 | | |
| |||
0 commit comments