Skip to content
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

feat: add support for custom filesystems #1

Merged
merged 3 commits into from
May 27, 2021
Merged

feat: add support for custom filesystems #1

merged 3 commits into from
May 27, 2021

Conversation

lefelys
Copy link
Contributor

@lefelys lefelys commented May 24, 2021

Enables work with embed.FS

@lefelys lefelys requested a review from slockij May 24, 2021 13:33
@lefelys lefelys self-assigned this May 24, 2021
Copy link

@timolinn timolinn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

file/file.go Outdated

ioFiles = append(ioFiles, info)
}
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pp]

func readFromFilesystem(path) ([]fs.FileInfo, error) {
   if filesystemCustom == nil {
      return ioutil.ReadDir(path)
    }
    ... these things when there's custome filesystem
}

func ReadMigrationFiles(path string, filenameRegex *regexp.Regexp) (files MigrationFiles, err error) {
   ioFiles, err := readFromFilesystem(path)
...

@lefelys lefelys merged commit 40d1281 into master May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants