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

error with dir.servers #4

Closed
benmonro opened this issue May 6, 2013 · 2 comments
Closed

error with dir.servers #4

benmonro opened this issue May 6, 2013 · 2 comments

Comments

@benmonro
Copy link

benmonro commented May 6, 2013

I'm trying to get this setup on my project and it seems that the 'dirs.server' in the temlate is undefined. Am I supposed to add that in somewhere?

Running "regarde" task
Warning: An error occurred while processing a template (dirs is not defined). Use --force to continue.

Aborted due to warnings.

@ericclemmons
Copy link
Owner

Oh yes, be sure to use some sort of pattern match for the the files attribute, such as:

grunt.initConfig({
  watch: {
    server: {
      files:  'path/to/**/*.js`,
      tasks:  [ 'express-server', 'livereload' ]
    }
  }
});

In my project, I have "constants" to simplify things a bit:

grunt.initConfig({
  dirs: {
    server: 'path/to/server/',
    client: 'path/to/client'
  },
  files: {
    all: '**/*',
    js: '**/*.js',
    html: '**/*.html'
  },
  watch: {
    server: {
      files:  '<%= dirs.server + files.all %>',
      tasks:  [ 'express-server', 'livereload' ]
    }
  }
});

This way, <%= dirs.server + files.all %> turns into path/to/server/**/*. Make sense?

What would you prefer the readme to say that would make more sense?

@benmonro
Copy link
Author

benmonro commented May 6, 2013

Ahhh, yeah I think just including the constants in the example...thanks
On May 6, 2013 12:40 PM, "Eric Clemmons" notifications@github.com wrote:

Oh yes, be sure to use some sort of pattern match for the the filesattribute, such as:

grunt.initConfig({
watch: {
server: {
files: 'path/to/*/.js`, tasks: [ 'express-server', 'livereload' ]
}
}});

In my project, I have "constants" to simplify things a bit:

grunt.initConfig({
dirs: {
server: 'path/to/server/',
client: 'path/to/client'
},
files: {
all: ''/*',
js: '
/.js',
html: '__/
.html'
},
watch: {
server: {
files: '<%= dirs.server + files.all %>',
tasks: [ 'express-server', 'livereload' ]
}
}
});

This way, <%= dirs.server + files.all %> turns into path/to/server/*/.
Make sense?

What would you prefer the readme to say that would make more sense?


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-17503183
.

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

No branches or pull requests

2 participants