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
8de13bd2
Commit
8de13bd2
authored
Sep 13, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move get_distributions function to utils
parent
dd221a6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
debomatic-webui/lib/debomatic.coffee
debomatic-webui/lib/debomatic.coffee
+2
-11
debomatic-webui/lib/utils.coffee
debomatic-webui/lib/utils.coffee
+13
-0
No files found.
debomatic-webui/lib/debomatic.coffee
View file @
8de13bd2
fs
=
require
(
"fs"
)
fs
=
require
(
"fs"
)
glob
=
require
(
"glob"
)
config
=
require
(
"./config"
)
config
=
require
(
"./config"
)
utils
=
require
(
"./utils"
)
utils
=
require
(
"./utils"
)
Tail
=
utils
.
Tail
Tail
=
utils
.
Tail
e
=
config
.
events
.
broadcast
e
=
config
.
events
.
broadcast
_get_distributions
=
(
callback
)
->
glob
"
#{
config
.
debomatic
.
path
}
/*/pool"
,
{},
(
err
,
directories
)
->
distributions
=
[]
for
dir
in
directories
name
=
dir
.
split
(
'/'
)[
-
2
..][
0
]
distributions
.
push
name
callback
(
distributions
)
class
Debomatic
class
Debomatic
...
@@ -20,13 +11,13 @@ class Debomatic
...
@@ -20,13 +11,13 @@ class Debomatic
@
status
=
{}
@
status
=
{}
@
distributions
=
[]
@
distributions
=
[]
@
running
=
fs
.
existsSync
(
config
.
debomatic
.
pidfile
)
@
running
=
fs
.
existsSync
(
config
.
debomatic
.
pidfile
)
_
get_distributions
(
distributions
)
=>
@
distributions
=
distributions
utils
.
get_distributions
(
distributions
)
=>
@
distributions
=
distributions
# watcher on new distributions
# watcher on new distributions
watch_distributions
:
->
watch_distributions
:
->
fs
.
watch
config
.
debomatic
.
path
,
(
event
,
fileName
)
=>
fs
.
watch
config
.
debomatic
.
path
,
(
event
,
fileName
)
=>
check
=
=>
check
=
=>
_
get_distributions
(
new_distributions
)
=>
utils
.
get_distributions
(
new_distributions
)
=>
if
not
utils
.
arrayEqual
(
@
distributions
,
new_distributions
)
if
not
utils
.
arrayEqual
(
@
distributions
,
new_distributions
)
@
distributions
=
new_distributions
@
distributions
=
new_distributions
@
sockets
.
emit
(
e
.
distributions
,
@
distributions
)
@
sockets
.
emit
(
e
.
distributions
,
@
distributions
)
...
...
debomatic-webui/lib/utils.coffee
View file @
8de13bd2
path
=
require
(
"path"
)
path
=
require
(
"path"
)
fs
=
require
(
"fs"
)
fs
=
require
(
"fs"
)
config
=
require
(
"./config"
)
config
=
require
(
"./config"
)
glob
=
require
(
"glob"
)
Tail
=
require
(
"tail"
).
Tail
Tail
=
require
(
"tail"
).
Tail
_check_no_backward
=
(
backward_path
)
->
_check_no_backward
=
(
backward_path
)
->
...
@@ -27,6 +28,17 @@ check_data_file = (data) ->
...
@@ -27,6 +28,17 @@ check_data_file = (data) ->
_check_no_backward
(
data
.
file
.
name
)
_check_no_backward
(
data
.
file
.
name
)
get_distributions
=
(
callback
)
->
glob
"
#{
config
.
debomatic
.
path
}
/*/pool"
,
{},
(
err
,
directories
)
->
if
err
errors_handler
"get_distributions"
,
err
return
distributions
=
[]
for
dir
in
directories
name
=
dir
.
split
(
'/'
)[
-
2
..][
0
]
distributions
.
push
name
callback
(
distributions
)
get_distribution_pool_path
=
(
data
)
->
get_distribution_pool_path
=
(
data
)
->
path
.
join
(
config
.
debomatic
.
path
,
data
.
distribution
.
name
,
"pool"
)
path
.
join
(
config
.
debomatic
.
path
,
data
.
distribution
.
name
,
"pool"
)
...
@@ -132,6 +144,7 @@ Tail::close = ->
...
@@ -132,6 +144,7 @@ Tail::close = ->
module
.
exports
.
check_data_distribution
=
check_data_distribution
module
.
exports
.
check_data_distribution
=
check_data_distribution
module
.
exports
.
check_data_package
=
check_data_package
module
.
exports
.
check_data_package
=
check_data_package
module
.
exports
.
check_data_file
=
check_data_file
module
.
exports
.
check_data_file
=
check_data_file
module
.
exports
.
get_distributions
=
get_distributions
module
.
exports
.
get_distribution_pool_path
=
get_distribution_pool_path
module
.
exports
.
get_distribution_pool_path
=
get_distribution_pool_path
module
.
exports
.
get_package_path
=
get_package_path
module
.
exports
.
get_package_path
=
get_package_path
module
.
exports
.
get_file_path
=
get_file_path
module
.
exports
.
get_file_path
=
get_file_path
...
...
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