-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
directory: simplify newImageDestination
The current code is unnecessarily complicated: - it does unnecessary checks if a file/directory exists before opening it; - it uses three helper functions not used anywhere else; - directory contents is read twice. Untangle all this, making the code simpler. Also, move the logic of initializing a destination directory to a separate function. Now, since the logic of handing version file is now encapsulated in a single function, remove versionPath method and const version, as well as the corresponding test. This also fixes the subtle issue of using ref.path for constructing the version file path, but ref.resolvedPath for all other operations. Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information
Showing
3 changed files
with
60 additions
and
97 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