cobalt.rs: Watch command loops endlessly

I ran cobalt watch on my project and then ran cd /my/project/dir in another terminal. Cobalt starts to endlessly rebuild the project.

Work around: add an ignore for your dest folder, like

ignore: ["build/*"]

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

@epage sorry for the slow response. Yes, the behavior is exactly as you describe it. I think the ignore functionality isn’t working properly.

I just tried this with a new Cobalt site, and it’s the same behavior.

<*> cobalt init coblog
[warn]   No .cobalt.yml file found in current directory, using default config.
[info]   Created new project at coblog
<*> cd coblog
<*> tree
.
├── build
│   ├── index.html
│   └── posts
│       └── post-1.html
├── index.liquid
├── _layouts
│   ├── default.liquid
│   └── post.liquid
└── posts
    └── post-1.md

I compiled Cobalt from master last week:

<*> cobalt -V
Cobalt 0.7.2

I have the default .cobalt.yml:

<*> cat .cobalt.yml
name: cobalt blog
source: "."
dest: "build"
ignore:
  - .git/*
  - build/*

Here is what happens when I compile from within the site directory:

<*> cobalt watch -s . -d "build"
[info]   Using config file .cobalt.yml
[info]   Building from . into build
[info]   Created build/posts/post-1.html
[info]   Created build/index.html
[info]   Copying remaining assets
[info]   Build successful
[info]   Serving "build" through static file server
[info]   Watching "." for changes
[info]   Server Listening on 127.0.0.1:3000
[info]   Ctrl-c to stop the server

< here I edited posts/post-1.md >

[info]   Building from . into build
[info]   Created build/index.html
[info]   Copying remaining assets
[info]   Build successful
[info]   Building from . into build
[info]   Created build/posts/post-1.html
[info]   Created build/index.html
[info]   Copying remaining assets
[info]   Build successful
[info]   Building from . into build
[info]   Created build/posts/post-1.html
[info]   Created build/index.html
[info]   Copying remaining assets
[info]   Build successful
...

I happened to find out today that the correct ignore syntax would be ignore: [".git/*"], which solves this issue.