Toggle navigation
Toggle navigation
This project
Loading...
Sign in
digsig
/
bsync-client
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Stefan Huber
2017-04-03 15:23:08 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
df1fe54934cc2e80aaa3adea3b716435c5865743
df1fe549
1 parent
9c64bb14
fix: node downloader
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
dist/node-build.js
dist/node-build.js.map
src/node-main.ts
dist/node-build.js
View file @
df1fe54
...
...
@@ -556,10 +556,11 @@ var Bsync = (function () {
Bsync
.
configIpcMain
=
function
(
ipcMain
,
basePath
)
{
ipcMain
.
on
(
'bsync-download'
,
function
(
event
,
args
)
{
var
nodeFileHander
=
new
NodeFileHandler
();
nodeFileHander
.
download
(
args
.
source
,
basePath
+
"/"
+
args
.
target
)
nodeFileHander
.
on
(
'progress'
,
function
(
progress
)
{
event
.
sender
.
send
(
'bsync-download-progress'
,
progress
);
})
.
once
(
'error'
,
function
(
error
)
{
nodeFileHander
.
removeAllListeners
();
event
.
sender
.
send
(
'bsync-download-error'
,
error
);
})
.
once
(
'complete'
,
function
()
{
nodeFileHander
.
removeAllListeners
();
event
.
sender
.
send
(
'bsync-download-complete'
);
});
.
once
(
'complete'
,
function
()
{
nodeFileHander
.
removeAllListeners
();
event
.
sender
.
send
(
'bsync-download-complete'
);
})
.
download
(
args
.
source
,
basePath
+
"/"
+
args
.
target
);
});
ipcMain
.
on
(
'bsync-cleanup'
,
function
(
event
,
args
)
{
var
nodeFileHandler
=
new
NodeFileHandler
();
...
...
dist/node-build.js.map
View file @
df1fe54
This diff is collapsed. Click to expand it.
src/node-main.ts
View file @
df1fe54
...
...
@@ -11,10 +11,12 @@ export default class Bsync {
ipcMain
.
on
(
'bsync-download'
,
(
event
,
args
)
=>
{
let
nodeFileHander
=
new
NodeFileHandler
();
nodeFileHander
.
download
(
args
.
source
,
basePath
+
"/"
+
args
.
target
)
nodeFileHander
.
on
(
'progress'
,
(
progress
:
number
)
=>
{
event
.
sender
.
send
(
'bsync-download-progress'
,
progress
);
})
.
once
(
'error'
,
(
error
)
=>
{
nodeFileHander
.
removeAllListeners
();
event
.
sender
.
send
(
'bsync-download-error'
,
error
);
})
.
once
(
'complete'
,
()
=>
{
nodeFileHander
.
removeAllListeners
();
event
.
sender
.
send
(
'bsync-download-complete'
);
});
.
once
(
'complete'
,
()
=>
{
nodeFileHander
.
removeAllListeners
();
event
.
sender
.
send
(
'bsync-download-complete'
);
})
.
download
(
args
.
source
,
basePath
+
"/"
+
args
.
target
);
});
ipcMain
.
on
(
'bsync-cleanup'
,
(
event
,
args
)
=>
{
...
...
Please
register
or
login
to post a comment