-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a simple implementation of solarkraft list
#64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
path: string | ||
): Generator<ListEntry> { | ||
for (const dirent of readdirSync(path, { withFileTypes: true })) { | ||
if (dirent.isDirectory() && /^[0-9]+$/.exec(dirent.name)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment explaining this regex
withFileTypes: true, | ||
})) { | ||
// match all storage entries | ||
const matcher = /^entry-([0-9a-fA-F]+)\.json$/.exec( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using mixed-case HEX here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be ok with lowercase, but neither Windows, nor MacOS agree with me on the capitalization of filenames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, OS jank
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added a comment
This PR implements
solarkraft list
. Since our file storage is very simple, the implementation is also simple.