Skip to content

Instantly share code, notes, and snippets.

@mikeymckay
Created May 26, 2016 08:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mikeymckay/160c386c2471c1c508cd6941ab019561 to your computer and use it in GitHub Desktop.
request = require 'request'
glob = require 'glob'
_ = require 'underscore'
database = process.argv.pop()
glob "**/*.coffee", (er, files) ->
_(files).each (view) ->
return if view.match(/__reduce/) or view is "executeViews.coffee"
view_name = view.replace(/\.coffee/,"")
viewUrl = "#{database}/_design/#{view_name}/_view/#{view_name}?limit=1"
console.log "Executing view: #{viewUrl}"
request viewUrl, (result) ->
console.log "Finished #{viewUrl}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment