Commit 7a7b8d6
fix(install): regenerate lockfile with --force on global install (denoland#33970)
## Summary
Fixes denoland#33934.
When `deno install --global --force` (or `--reload`) was used, the
auto-generated lockfile at `<bin>/.<name>/deno.lock` still pinned the
old version, so version resolution returned the previously locked
version instead of the latest.
This change removes the stale lockfile before re-running resolution in
`setup_config_dir` when `--force` or `--reload` is specified. The user
is explicitly asking for a fresh install in those cases, so honoring a
stale auto-generated lockfile is a footgun.
## Test plan
- [x] Added `install_force_regenerates_lockfile` unit test
- [x] Added `install_reload_regenerates_lockfile` unit test
- [x] `cargo build --bin deno` passes
- [x] `./tools/format.js` + `./tools/lint.js` clean
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>1 parent 05e01ff commit 7a7b8d6
1 file changed
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
188 | 189 | | |
189 | 190 | | |
190 | 191 | | |
| |||
421 | 422 | | |
422 | 423 | | |
423 | 424 | | |
| 425 | + | |
424 | 426 | | |
425 | 427 | | |
426 | 428 | | |
| |||
443 | 445 | | |
444 | 446 | | |
445 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
446 | 460 | | |
447 | 461 | | |
448 | 462 | | |
| |||
1220 | 1234 | | |
1221 | 1235 | | |
1222 | 1236 | | |
| 1237 | + | |
1223 | 1238 | | |
1224 | 1239 | | |
1225 | 1240 | | |
| |||
1797 | 1812 | | |
1798 | 1813 | | |
1799 | 1814 | | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
1800 | 1863 | | |
1801 | 1864 | | |
1802 | 1865 | | |
| |||
0 commit comments