我正在使用Jekyll 3.1.1生成一个博客,我最近引入了一个Git钩子来自动发布预推更改.
引入此钩子后,我在运行时开始收到以下错误jekyll serve:
Configuration file: /Users/egillespie/Projects/blog.givingjar.org/_config.yml
Source: /Users/egillespie/Projects/blog.givingjar.org
Destination: /Users/egillespie/Projects/blog.givingjar.org/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.223 seconds.
** ERROR: directory is already being watched! **
Directory: /Users/egillespie/Projects/blog.givingjar.org/node_modules/git-scripts/bin/hooks
is already being watched through: /Users/egillespie/Projects/blog.givingjar.org/node_modules/git-scripts/bin/hooks
MORE INFO: https://github.com/guard/listen/wiki/Duplicate-directory-errors
Auto-regeneration: enabled for '/Users/egillespie/Projects/blog.givingjar.org'
Configuration file: /Users/egillespie/Projects/blog.givingjar.org/_config.yml
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
Run Code Online (Sandbox Code Playgroud)
什么是特殊的是我排除node_modules在_config.yml:
exclude:
- Gemfile
- Gemfile.lock
- LICENSE
- README.md
- package.json
- Gruntfile.js
- node_modules
Run Code Online (Sandbox Code Playgroud)
node_modules正确地被排除在建筑物之外(即没有node_modules子目录_site).
我也排除node_modules在.gitignore:
# project
node_modules
_site*
.sass-cache
.jekyll-metadata
# general
.DS_Store
Thumbs.db
ehthumbs.db
Run Code Online (Sandbox Code Playgroud)
基于这个GitHub问题和这个提交似乎node_modules应该从手表中排除,但事实并非如此.如果有另一种方法可以从手表中排除文件,我无法从文档中解读.
从手表中排除目录并避免上述错误的正确方法是什么?
_config.yml 中排除参数的值应该是一个数组,即
exclude: ['_site', 'node_modules', ...]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2602 次 |
| 最近记录: |