Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mycard
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
syntax_j
mycard
Commits
22e387e1
Commit
22e387e1
authored
Sep 08, 2016
by
神楽坂玲奈
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aria2c
parent
b5d74f88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
index.js
index.js
+10
-7
No files found.
index.js
View file @
22e387e1
...
...
@@ -90,13 +90,14 @@ function createAria2c() {
default
:
throw
'
unsupported platform
'
;
}
const
aria2c
=
child_process
.
spawn
(
aria2c_path
,
[
'
--enable-rpc
'
,
'
--rpc-allow-origin-all
'
],
{
detached
:
true
}
);
let
aria2c
=
child_process
.
spawn
(
aria2c_path
,
[
'
--enable-rpc
'
,
'
--rpc-allow-origin-all
'
]
);
aria2c
.
on
(
'
data
'
,
(
data
)
=>
{
console
.
log
(
data
);
})
return
aria2c
;
}
createAria2c
();
c
onst
aria2c
=
c
reateAria2c
();
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
...
...
@@ -133,11 +134,7 @@ app.on('ready', createWindow)
// Quit when all windows are closed.
app
.
on
(
'
window-all-closed
'
,
function
()
{
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if
(
process
.
platform
!==
'
darwin
'
)
{
app
.
quit
()
}
app
.
quit
()
})
app
.
on
(
'
activate
'
,
function
()
{
...
...
@@ -151,3 +148,9 @@ app.on('activate', function () {
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
app
.
on
(
'
quit
'
,
()
=>
{
// windows 在非 detach 模式下会自动退出子进程
if
(
process
.
platform
!=
'
win32
'
)
{
aria2c
.
kill
()
}
})
\ No newline at end of file
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