From a6cfae3762ce99b2fe0679e096ebe353ac515ff1 Mon Sep 17 00:00:00 2001 From: Lisa Milne Date: Mon, 18 Dec 2023 12:02:07 +1000 Subject: [PATCH] fix bugs with scripts not restoring properly --- clite/core.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clite/core.js b/clite/core.js index 4c4be6f..a350592 100644 --- a/clite/core.js +++ b/clite/core.js @@ -2567,8 +2567,14 @@ clite.vfs = { if (!n) return false; } - if (clite.lib.getFileType({node:n}) != type) - return false; + let ntype = clite.lib.getFileType({node:n}); + if (ntype != type) { + if (!( + (ntype == clite.io.types.FT_SCRIPT || ntype == clite.io.types.FT_TEXT) + && (type == clite.io.types.FT_SCRIPT || type == clite.io.types.FT_TEXT) + )) + return false; + } n.uid = uid; n.gid = gid;