Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Ignore dot-files in the patch dir #15

Closed
rfk opened this issue Mar 9, 2015 · 4 comments
Closed

Ignore dot-files in the patch dir #15

rfk opened this issue Mar 9, 2015 · 4 comments

Comments

@rfk
Copy link
Contributor

rfk commented Mar 9, 2015

If I try to run the patcher while I've got a patch file open in vim, I get this error:

Unknown file format: /Users/rfk/repos/mozilla/identity/fxa-auth-db-mysql/db/schema/.patch-008-009.sql.swp

It's trying to read the vim swapfile as a patch. I think we'd be pretty safe to apply unix tradition and ignore filenames that start with a dot. We could even explicitly filter only that with particular file extensions, in case people want to put e.g. a readme in the patch directory.

@chilts
Copy link
Contributor

chilts commented Mar 9, 2015

I think some kind of patch filename format would be the winner and exclude everything else. (This breaks with me with Emacs backup files with names like *~.)

At the moment it's doing a fs.readdir() which grabs all files in the directory and then checks the filename matches /-(\d+)-(\d+)\.sql$/. Instead, perhaps it should just glob on prefix-*-*.sql and allow you to specify prefix which defaults to patch.

@rfk
Copy link
Contributor Author

rfk commented Mar 9, 2015

👍

@chilts
Copy link
Contributor

chilts commented Mar 16, 2015

PR here : #16

@chilts
Copy link
Contributor

chilts commented Mar 16, 2015

Fixed in the PR above.

@chilts chilts closed this as completed Mar 16, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants