diff options
author | Minteck <contact@minteck.org> | 2022-01-21 19:08:31 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-01-21 19:08:31 +0100 |
commit | b0e05b2a7ba1c0683c376c192d7d3abcbad2a0f4 (patch) | |
tree | c8894a68971b3d17220a13a153b98d1b2bd2e5d8 /modules/publishtag.js | |
parent | 3a04cb197f152f171fba679663a91a9bb61d710e (diff) | |
download | cobalt-b0e05b2a7ba1c0683c376c192d7d3abcbad2a0f4.tar.gz cobalt-b0e05b2a7ba1c0683c376c192d7d3abcbad2a0f4.tar.bz2 cobalt-b0e05b2a7ba1c0683c376c192d7d3abcbad2a0f4.zip |
Fix issue with Android (and potentially Linux)
Diffstat (limited to 'modules/publishtag.js')
-rw-r--r-- | modules/publishtag.js | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/modules/publishtag.js b/modules/publishtag.js index 9828443..8f0baa2 100644 --- a/modules/publishtag.js +++ b/modules/publishtag.js @@ -1,16 +1,5 @@ const fs = require('fs'); module.exports = (file) => { - file = fs.readFileSync(file).toString(); - try { - frontmatter = file.split("---")[1].trim() - lines = frontmatter.replaceAll("\r\n", "\n").split("\n"); - if (lines.map(i => i.trim()).includes("publish: true") || lines.map(i => i.trim()).includes("publish : true") || lines.map(i => i.trim()).includes("publish :true")) { - return true; - } else { - return false; - } - } catch (e) { - return false; - } + return fs.readFileSync(file).toString().match(/---\n(.*)\npublish( *):( *)true\n(.*)---/gm) }
\ No newline at end of file |