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

Treat absent files as empty when changes script #230

Merged
merged 1 commit into from
Jul 5, 2015

Conversation

spalenza
Copy link
Contributor

Hi,

The check_for_changes_script method don't treat diff to new files. I try use this rake to skip rails seed created by @m3nd3s.

desc "Seeding data to Database."
task :'db_seed' do
  seed_files = Dir['db/seeds/*.rb']
  seed_files.push("db/seeds.rb")

  queue check_for_changes_script({
    check: 'db/seeds.rb',
    at: seed_files,
    skip: %[
      echo "-----> DB seed unchanged; skipping DB seed"
    ],
    changed: %[
      echo "-----> Seeding database"
      #{echo_cmd %[#{rake} db:seed]}
    ],
    default: %[
      echo "-----> Seeding database"
      #{echo_cmd %[#{rake} db:seed]}
    ]
  })
end

Then, using -N param in diff command for treat absent files as empty. 😄

@m3nd3s
Copy link

m3nd3s commented Sep 29, 2014

+1

@gabskoro
Copy link
Member

gabskoro commented Oct 4, 2014

Hi, I'm also thinking of adding this seed task to mina, what do you think, does it make sense to at it in the deploy.rb script to executed on every deploy like migrate and precompile?

@spalenza
Copy link
Contributor Author

spalenza commented Oct 4, 2014

Hi! It's make a sense for me because I use this to seeds file. I think this is good for migrate but I don't test. I add in my deploy.rb.

d4be4st added a commit that referenced this pull request Jul 5, 2015
Treat absent files as empty when changes script
@d4be4st d4be4st merged commit f05be4d into mina-deploy:master Jul 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants