]> git.lizzy.rs Git - local-nhentai.git/blobdiff - fzf.js
Generic stats and select
[local-nhentai.git] / fzf.js
diff --git a/fzf.js b/fzf.js
index 85f544c1ab4b176aa7b40bc94badf71185863b07..27bb7c258df2b2341cc4862298d34fe19f821341 100644 (file)
--- a/fzf.js
+++ b/fzf.js
@@ -1,6 +1,6 @@
 const child = require("child_process")
 
-module.exports = (options, binary = "fzf") => {
+module.exports.fzf = (options, binary = "fzf") => {
        let res, rej
        const prom = new Promise((rs, rj) => [res, rej] = [rs, rj])
 
@@ -22,3 +22,6 @@ module.exports = (options, binary = "fzf") => {
 
        return prom
 }
+
+module.exports.doujin = doujins => module.exports.fzf(doujins.sort(), __dirname + "/fzf-previews")
+       .then(doujin => child.spawn("firefox", [`file://${process.cwd()}/${doujin}/index.html`]))