Repository navigation
Commit da2a20f
fix: enable nullglob to avoid glob expansion errors when no node versions installed
Fixes nvm-sh#3727
When no node versions are installed, nvm ls produces errors like:
`find: /path/.nvm/versions/node/*: No such file or directory`
This happens because bash expands `*` literally when nullglob is not
set and the directory is empty.
Solution:
- Temporarily enable nullglob before the find command
- Restore nullglob to its previous state after the command completes
- This allows the original find syntax to work correctly with empty directories1 parent 630a01f commit da2a20f
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1532 | 1532 | | |
1533 | 1533 | | |
1534 | 1534 | | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
1535 | 1545 | | |
1536 | 1546 | | |
1537 | 1547 | | |
| |||
1547 | 1557 | | |
1548 | 1558 | | |
1549 | 1559 | | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
1550 | 1564 | | |
1551 | 1565 | | |
1552 | 1566 | | |
| |||
0 commit comments