Toggle navigation
Toggle navigation
This project
Loading...
Sign in
성준영
/
klas-file-downloader
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
성준영
2017-05-31 17:26:55 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
dcc78200a4a1d996ca4a47fdd53590fbf5dd29f0
dcc78200
1 parent
4ce61143
(bugfix) 파일 다운로드 중 프로세스 종료되는 버그 수정
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
7 deletions
functions.js
index.js
package.json
functions.js
View file @
dcc7820
...
...
@@ -282,10 +282,10 @@ exports.downloadSelectedFiles = function (selectedFiles, selectLecture, download
let
count
=
0
;
selectedFiles
.
files
.
forEach
(
function
(
value
,
index
)
{
request
=
https
.
get
(
value
.
link
,
function
(
response
)
{
count
++
;
let
file
=
fs
.
createWriteStream
(
downloadPath
+
value
.
fileName
);
response
.
pipe
(
file
);
count
++
;
if
(
selectedFiles
.
files
.
length
===
count
)
{
resolve
(
'\n 파일이 '
+
downloadPath
+
' 에 저장되었어요! 열공 :)'
);
}
...
...
index.js
View file @
dcc7820
...
...
@@ -41,11 +41,9 @@ if (require.main === module) {
})
.
then
(
function
(
result
)
{
console
.
log
(
result
);
process
.
exit
();
})
.
catch
(
function
(
err
)
{
console
.
log
(
err
);
process
.
exit
();
});
}
else
{
var
selectLecture
;
...
...
@@ -63,11 +61,9 @@ if (require.main === module) {
})
.
then
(
function
(
result
)
{
console
.
log
(
result
);
process
.
exit
();
})
.
catch
(
function
(
err
)
{
console
.
log
(
err
);
process
.
exit
();
})
}
...
...
package.json
View file @
dcc7820
{
"name"
:
"klas-file-downloader"
,
"version"
:
"0.1.
5
"
,
"version"
:
"0.1.
7
"
,
"description"
:
"Project that download lecture reference files from Klas"
,
"main"
:
"index.js"
,
"scripts"
:
{
...
...
Please
register
or
login
to post a comment