Commit 354ca4cc authored by Leo Iannacone's avatar Leo Iannacone

fire send only if a file is created or deleted (event is "rename")

parent 893466ec
...@@ -52,6 +52,7 @@ io.sockets.on('connection', function(socket) { ...@@ -52,6 +52,7 @@ io.sockets.on('connection', function(socket) {
packages_path = path.join(config.debomatic_path, data.distribution.name, 'pool') packages_path = path.join(config.debomatic_path, data.distribution.name, 'pool')
try { try {
watchIncomingPackages = fs.watch(packages_path, { persistent: true}, function(event, fileName) { watchIncomingPackages = fs.watch(packages_path, { persistent: true}, function(event, fileName) {
if (event == 'rename')
send.view(socket, data); send.view(socket, data);
}); });
watchers.push(watchIncomingPackages); watchers.push(watchIncomingPackages);
...@@ -61,6 +62,7 @@ io.sockets.on('connection', function(socket) { ...@@ -61,6 +62,7 @@ io.sockets.on('connection', function(socket) {
pack_path = path.join(packages_path, data.package.name + '_' + data.package.version); pack_path = path.join(packages_path, data.package.name + '_' + data.package.version);
try { try {
watchPackageFiles = fs.watch(pack_path, {persistent: true}, function (event, filename) { watchPackageFiles = fs.watch(pack_path, {persistent: true}, function (event, filename) {
if (event == 'rename')
send.view(socket, data); send.view(socket, data);
}); });
watchers.push(watchPackageFiles) watchers.push(watchPackageFiles)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment