-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (26 loc) · 1.07 KB
/
index.js
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
import mangaPainter from "./src/manga-painter"
import createPDFs from "./src/algorithms/create-pdf"
import readline from "readline-sync"
import chromeOpn from "chrome-opn"
import path from "path"
import { designStartMangaPainter, designOpenGooglechrome } from "./src/design/design"
async function start() {
const nameFileFolderPathAndFileFolder = askAnReturnPathFiles()
await mangaPainter(nameFileFolderPathAndFileFolder)
const colorfulPDFPath = createPDFs(nameFileFolderPathAndFileFolder)
openFile(colorfulPDFPath)
function askAnReturnPathFiles() {
designStartMangaPainter()
const fileFolder= readline.question("What folder are the files? ")
const fileFolderPath = path.join(path.resolve(), `/manga/images/black-and-white/${fileFolder}/`)
const fileFolderName = fileFolder.replace(/_/g, "-").replace(/\//g, "-")
return {fileFolderPath, fileFolderName}
}
function openFile(colorfulPDFPath) {
designOpenGooglechrome()
setTimeout(() => {
chromeOpn(colorfulPDFPath)
}, 7000)
}
}
start()