-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
26 lines (22 loc) · 740 Bytes
/
Copy pathindex.js
File metadata and controls
26 lines (22 loc) · 740 Bytes
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
import DirectoryFile from "./lib/directoryfile.js";
import Thumbnailer from "./lib/thumbnailer.js";
const StlsToImage = class StlsToImage {
constructor() {
}
run() {
if ( process.argv[2] == undefined ) {
console.log("No directory given as parameter");
process.exit();
} else {
const files = new DirectoryFile();
const thumbnailer = new Thumbnailer();
files.recursiveRead(process.argv[2], item => {
if ( item.file.endsWith(".stl") ) {
thumbnailer.addThumbnail(item.path, item.path+".png", 200, 200, "rgb(190, 39, 36)");
}
});
}
}
}
const app = new StlsToImage();
app.run();