-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.ts
40 lines (34 loc) · 817 Bytes
/
app.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import minimist from 'minimist'
import Default from './src/default'
import PYYTBUPLOADER from './src/py-ytbuploader'
import { Install } from './src/install'
const defaultIn = new Default()
const pyYtbUploader = new PYYTBUPLOADER()
const cliArgs = minimist(process.argv.slice(2))
async function runPy() {
let video = await defaultIn.walkDir(cliArgs.dir)
//log(video)
for (const uploadInfo of video) {
pyYtbUploader.upload(uploadInfo, cliArgs)
}
}
async function runPy2() {
let video = await defaultIn.readDir(cliArgs.dir)
//log(video)
for (const uploadInfo of video) {
pyYtbUploader.upload(uploadInfo, cliArgs)
}
}
async function app() {
if (cliArgs.i) {
runPy()
} else {
runPy2()
}
}
console.log(cliArgs)
if (cliArgs.install) {
new Install().install()
} else {
app()
}