From b7ba8282a713743883bb9f21f83bd78d8b5a76b8 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Thu, 18 Jul 2019 12:05:11 +0900 Subject: [PATCH] Fixed docs path for build. --- desktop/sources/scripts/commander.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/desktop/sources/scripts/commander.js b/desktop/sources/scripts/commander.js index 720de5b..b7aae9b 100644 --- a/desktop/sources/scripts/commander.js +++ b/desktop/sources/scripts/commander.js @@ -212,11 +212,12 @@ function Commander (ronin) { this.docs = { dict: {}, - path: 'sources/scripts/library.js', load: function () { const fs = require('fs') - if (!fs.existsSync(this.path)) { console.warn('Docs', 'File does not exist: ' + this.path); return } - const lines = fs.readFileSync(this.path, 'utf8').split('\n').filter((line) => { return line.substr(0, 7) === ' this.' }) + const path = require('path') + const p = path.join(__dirname, 'scripts/', 'library.js') + if (!fs.existsSync(p)) { console.warn('Docs', 'File does not exist: ' + p); return } + const lines = fs.readFileSync(p, 'utf8').split('\n').filter((line) => { return line.substr(0, 7) === ' this.' }) return lines.map((line) => { return line.trim().substr(5).trim() }) }, install: function (payload = this.load()) {