summaryrefslogtreecommitdiff
path: root/src/node/utils
diff options
context:
space:
mode:
authorChris Birk <cmbirk@gmail.com>2015-12-17 21:54:04 -0600
committerChris Birk <cmbirk@gmail.com>2015-12-17 21:54:04 -0600
commit7f517eca0bf87b7b9b666e36aeb8cc219f3d80be (patch)
treee805e930d6ae8a5b817986d8c7e997a324f17f32 /src/node/utils
parente98821cef745d1674bcdd72c96b00ab39ed8597c (diff)
downloadetherpad-lite-7f517eca0bf87b7b9b666e36aeb8cc219f3d80be.zip
check for soffice before removing export paths
Diffstat (limited to 'src/node/utils')
-rw-r--r--src/node/utils/Settings.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/node/utils/Settings.js b/src/node/utils/Settings.js
index 325a997a..b765670a 100644
--- a/src/node/utils/Settings.js
+++ b/src/node/utils/Settings.js
@@ -222,6 +222,27 @@ exports.abiwordAvailable = function()
}
};
+exports.sofficeAvailable = function () {
+ if(exports.soffice != null) {
+ return os.type().indexOf("Windows") != -1 ? "withoutPDF": "yes";
+ } else {
+ return "no";
+ }
+};
+
+exports.exportAvailable = function () {
+ var abiword = exports.abiwordAvailable();
+ var soffice = exports.sofficeAvailable();
+
+ if(abiword == "no" && soffice == "no") {
+ return "no";
+ } else if ((abiword == "withoutPDF" && soffice == "no") || (abiword == "no" && soffice == "withoutPDF")) {
+ return "withoutPDF";
+ } else {
+ return "yes";
+ }
+};
+
// Provide git version if available
exports.getGitCommit = function() {
var version = "";
@@ -375,6 +396,20 @@ exports.reloadSettings = function reloadSettings() {
}
}
+ if(exports.soffice) {
+ fs.exists(exports.soffice, function (exists) {
+ if(!exists) {
+ var sofficeError = "SOffice does not exist at this path, check your settings file";
+
+ if(!exports.suppressErrorsInPadText) {
+ exports.defaultPadText = exports.defaultPadText + "\nError: " + sofficeError + suppressDisableMsg;
+ }
+ console.error(sofficeError);
+ exports.soffice = null;
+ }
+ });
+ }
+
if (!exports.sessionKey) {
try {
exports.sessionKey = fs.readFileSync("./SESSIONKEY.txt","utf8");