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

Ignore DS_Store files #18

Closed
allistera opened this issue Nov 26, 2012 · 5 comments
Closed

Ignore DS_Store files #18

allistera opened this issue Nov 26, 2012 · 5 comments

Comments

@allistera
Copy link

Sadly when creating files OSX creates hidden .DS_Store by default. This breaks running revisions, the only fix is to delete the .DS_Store from the command line or enable view hidden files in finder and deleting it.

@victorstanciu
Copy link
Owner

I'm sorry, I don't quite understand, how does this break revisions? Any file not ending in .sql should be ignored by dbv.php, .DS_Store files aren't supposed to appear in the revision script listing.

@allistera
Copy link
Author

Here are the steps I done to create the bug:

  • Create Folder 1
  • Create new file 'test.sql'
  • Opened DBV and expanded revision Added sample config file #1
  • Was unable to run selected revision (No errors returned) unless I manually deleted DS_Store

Pic of DS_Store appearing: http://i.imgur.com/yxTsU.png

@victorstanciu
Copy link
Owner

Hmm, do you have the latest version? Because this shouldn't happen since 988d865. Please update to the latest version https://github.com/victorstanciu/dbv/tags and let me know if you still have this problem.

@allistera
Copy link
Author

yes I am using version 1.0.3. I had a look and it seems as if the _getRevisionFiles method in the DBV class is just looping around and returning every file in the specific revision folder. Line 353 needs to be changed from:

if ($file->isFile()) {

to the same as you have in the _getDiskSchema method:

if ($file->isFile() && pathinfo($file->getFilename(), PATHINFO_EXTENSION) == 'sql') {

I would submit a pull request but I don't have git installed on this computer.

@victorstanciu
Copy link
Owner

Oops, you're right, I forgot to add the check to that method too. I commited 6d00ee2 right now, you don't have to fork/pull request. Thank you for submitting the issue!

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