Commit 063fb6f
authored
fix: detect xlings package path and fallback MCPP_HOME to ~/.mcpp (#60)
When mcpp is installed via `xlings install mcpp`, the binary lives at
~/.xlings/data/xpkgs/xim-x-mcpp/<ver>/bin/mcpp. The previous
home_dir() detected bin/ and used the grandparent (the xpkgs package
directory) as MCPP_HOME, creating a nested xlings sandbox that broke
toolchain installation and lost installed toolchains on mcpp upgrade.
Now home_dir() checks for the data/xpkgs ancestor pattern and falls
back to ~/.mcpp/ (same behavior as CI with explicit MCPP_HOME).
Also extract default_mcpp_home() with unified Windows (%USERPROFILE%)
and POSIX ($HOME) fallback logic.1 parent 326f97c commit 063fb6f
2 files changed
Lines changed: 55 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
171 | 182 | | |
| 183 | + | |
172 | 184 | | |
173 | 185 | | |
174 | 186 | | |
175 | | - | |
176 | 187 | | |
177 | 188 | | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
186 | 200 | | |
187 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
188 | 206 | | |
189 | | - | |
190 | | - | |
| 207 | + | |
| 208 | + | |
191 | 209 | | |
192 | 210 | | |
193 | | - | |
194 | | - | |
195 | | - | |
| 211 | + | |
196 | 212 | | |
197 | 213 | | |
198 | 214 | | |
| |||
0 commit comments