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-11 01:54:07 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
faebba54be00f86e356b2bd7b79fcd7eb1f4c6ee
faebba54
1 parent
25012827
TODO (전체 옵션을 주면 강의 전체 강의자료를 다운받을 수 있게) 추가
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
index.js
index.js
View file @
faebba5
...
...
@@ -5,6 +5,7 @@ var functions = require('./functions');
// var os = require('os');
//TODO 예외처리
if
(
require
.
main
===
module
){
// 커멘드 라인 상에서 직접적으로 불려졌을 때
...
...
@@ -12,7 +13,8 @@ if(require.main === module){
args
.
option
(
'id'
,
'[필수] 학번을 입력합니다.'
)
.
option
(
'pw'
,
'[필수] 비밀번호를 입력합니다. 로컬 PC 에서만 사용하기 때문에 안전합니다 :).'
)
.
option
(
'downloadPath'
,
'[선택] 자료를 다운받을 경로를 입력합니다. (default 는 ~/Downloads 입니다.)'
);
.
option
(
'downloadPath'
,
'[선택] 자료를 다운받을 경로를 입력합니다. (default 는 ~/Downloads 입니다.)'
)
.
option
(
'all'
,
'[선택] 다음 옵션을 주면 모든 강의의 자료를 다운받습니다.'
);
const
flags
=
args
.
parse
(
process
.
argv
);
...
...
@@ -29,7 +31,14 @@ if(require.main === module){
.
then
(
functions
.
selectLecture
)
.
then
(
functions
.
getClassPageBody
)
.
then
(
functions
.
findFiles
)
.
then
(
functions
.
selectChapter
)
.
then
(
function
(
chapterFilesArr
){
if
(
flags
.
all
){
// TODO 전체강의 다운받는 함수 구현
}
else
{
return
functions
.
selectChapter
(
chapterFilesArr
);
}
})
.
then
(
function
(
selectedFiles
){
return
functions
.
downloadSelectedFiles
(
selectedFiles
,
flags
.
downloadPath
);
})
...
...
Please
register
or
login
to post a comment