Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
893466ec
Commit
893466ec
authored
Mar 08, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
watch on filesystem changes
parent
9d2950d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
1 deletion
+41
-1
debomatic-webui/app.js
debomatic-webui/app.js
+41
-1
No files found.
debomatic-webui/app.js
View file @
893466ec
...
...
@@ -8,6 +8,7 @@ var express = require('express')
,
config
=
require
(
'
./config.js
'
)
,
send
=
require
(
'
./send.js
'
)
,
fs
=
require
(
'
fs
'
)
,
path
=
require
(
'
path
'
)
var
app
=
module
.
exports
=
express
.
createServer
();
...
...
@@ -40,7 +41,46 @@ app.get('/', routes.index);
io
.
sockets
.
on
(
'
connection
'
,
function
(
socket
)
{
send
.
distributions
(
socket
);
socket
.
on
(
'
get-view
'
,
function
(
data
)
{
send
.
view
(
socket
,
data
);
socket
.
get
(
'
view
'
,
function
(
err
,
view
)
{
if
(
!
view
||
view
!=
data
)
{
socket
.
get
(
'
watchers
'
,
function
(
err
,
watchers
)
{
if
(
watchers
)
watchers
.
forEach
(
function
(
w
){
w
.
close
()
});
watchers
=
[]
socket
.
set
(
'
view
'
,
data
,
function
()
{
packages_path
=
path
.
join
(
config
.
debomatic_path
,
data
.
distribution
.
name
,
'
pool
'
)
try
{
watchIncomingPackages
=
fs
.
watch
(
packages_path
,
{
persistent
:
true
},
function
(
event
,
fileName
)
{
send
.
view
(
socket
,
data
);
});
watchers
.
push
(
watchIncomingPackages
);
}
catch
(
err
)
{}
if
(
data
.
package
&&
data
.
package
.
name
&&
data
.
package
.
version
)
{
pack_path
=
path
.
join
(
packages_path
,
data
.
package
.
name
+
'
_
'
+
data
.
package
.
version
);
try
{
watchPackageFiles
=
fs
.
watch
(
pack_path
,
{
persistent
:
true
},
function
(
event
,
filename
)
{
send
.
view
(
socket
,
data
);
});
watchers
.
push
(
watchPackageFiles
)
}
catch
(
err
)
{}
}
socket
.
set
(
'
watchers
'
,
watchers
);
});
});
send
.
view
(
socket
,
data
);
};
});
});
});
io
.
sockets
.
on
(
'
disconnect
'
,
function
(
socket
){
socket
.
get
(
'
watchers
'
,
function
(
err
,
watchers
)
{
if
(
watchers
)
watchers
.
forEach
(
function
(
w
){
w
.
close
()
});
socket
.
set
(
'
watchers
'
,
[]);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment