Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: don't expose tempdir in common.state
Previously, the cached `tempdir` value was stored in `common.state`. Unlike the other `common.state` values, this isn't immediately useful to other commands (they can just call the tempdir API). So, this moves the cached value into `tempdir.js`. This also adds a unit test for the caching behavior, and exposes test-only helpers to verify this behavior. Finally, this adds a note to `common.state` that values should generally be considered read-only, since this can be important for customized behavior. Although, I recognize our code base has one exception to this rule (`echo()`), we should strive to maintain this. Fixes #902 Test: Added a unit test.
- Loading branch information
Showing
4 changed files
with
33 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters