mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Stop all watchers before attempting to replace directory with file
I think that the notify subprocess might be holding a lock on the watched directory on Windows.
This commit is contained in:
@@ -606,13 +606,12 @@ class PathWatcherManager {
|
||||
// Private: Stop all living watchers.
|
||||
//
|
||||
// Returns a {Promise} that resolves when all native watcher resources are disposed.
|
||||
stopAllWatchers () {
|
||||
async stopAllWatchers () {
|
||||
if (this.useExperimentalWatcher()) {
|
||||
this.notifyWatcher.kill()
|
||||
await this.notifyWatcher.kill()
|
||||
this.notifyWatcher = null
|
||||
return Promise.resolve()
|
||||
} else {
|
||||
return Promise.all(
|
||||
await Promise.all(
|
||||
Array.from(this.live, ([, w]) => w.stop())
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user