mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 08:56:17 -04:00
check for soffice before removing export paths
This commit is contained in:
parent
e98821cef7
commit
7f517eca0b
3 changed files with 51 additions and 12 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue