(root string, timeout time.Duration)
| 215 | } |
| 216 | |
| 217 | func waitForDaemonState(root string, timeout time.Duration) *watch.State { |
| 218 | deadline := time.Now().Add(timeout) |
| 219 | for time.Now().Before(deadline) { |
| 220 | if state := watch.ReadState(root); state != nil { |
| 221 | return state |
| 222 | } |
| 223 | time.Sleep(100 * time.Millisecond) |
| 224 | } |
| 225 | return nil |
| 226 | } |
| 227 | |
| 228 | // RunHook executes the named hook with the given project root |
| 229 | func RunHook(hookName, root string) error { |