Don't try to use Zotero.isWin in OS.File shim

This commit is contained in:
Dan Stillman 2024-05-21 01:55:22 -04:00
parent eed7acff08
commit 03be938444

View file

@ -1,6 +1,8 @@
// //
// Compatibility shims from the Mozilla codebase // Compatibility shims from the Mozilla codebase
// //
const isWin = Services.appinfo.OS == 'WINNT';
export let OS = { export let OS = {
Constants: { Constants: {
Path: { Path: {
@ -184,7 +186,7 @@ export let OS = {
setPermissions: async function (path, { unixMode, winAttributes } = {}) { setPermissions: async function (path, { unixMode, winAttributes } = {}) {
await IOUtils.setPermissions(path, unixMode); await IOUtils.setPermissions(path, unixMode);
if (winAttributes && Zotero.isWin) { if (winAttributes && isWin) {
let { readOnly, hidden, system } = winAttributes; let { readOnly, hidden, system } = winAttributes;
await IOUtils.setWindowsAttributes(path, { readOnly, hidden, system }); await IOUtils.setWindowsAttributes(path, { readOnly, hidden, system });
} }