-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make Snapshot directory & file extension configurable (#39)
* make Snapshot directory & file extension configurable This let's users adjust the behaviour of abide's interaction with the filesystem, exporting Snapshot Dir & Ext variables. I've adjusted the LoadSnapshots function to directly set the internal allSnapshots variable (this is the only way loadSnapshots was being used). This is intended as a short-ish term stopgap, allowing users to adjust vars like SnapshotDir then call LoadSnapshots() to have these changes take effect. I've added documentation of this to the readme.md. closes #37 * delay call to LoadDatasets with a sync.Once, add config to example pkg turns out the call to LoadDatasets needs to be delayed if the path is to be set outside of the abide package, otherwise abide will always create a dir called `__snapshots__`, even when not in use. To accomplish this & try to keep the interface simple, I've made 'loadSnapshots' private, wrapped it in a sync.Once, and added calls within private methods. using sync the load function will only be called one time, so the performance overhead of this is negligable. Finally, I made `snapshotExt` private again, realizing that it's probably a bad idea to encourage users to customize the file exension. Abide should proably enforce this "new file format" across the board.
- Loading branch information
Showing
6 changed files
with
60 additions
and
18 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
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
File renamed without changes.