Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

setup: support generating flatpak sources from windows

Abdullah Atta3450f2d19d28
diff --git a/scripts/generate-sources.mjs b/scripts/generate-sources.mjs
index 2fcba9d4f..d96c6049d 100644
--- a/scripts/generate-sources.mjs
+++ b/scripts/generate-sources.mjs
@@ -16,7 +16,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-
import fs from "fs/promises";
import fsSync from "fs";
import path from "path";
@@ -24,6 +23,7 @@ import { spawnSync } from "child_process";
import { fileURLToPath } from "url";
async function move(from, to) {
+ if (!fsSync.existsSync(from) || fsSync.existsSync(to)) return;
try {
await fs.rename(from, to);
} catch {
@@ -103,9 +103,22 @@ for (const lockfile of lockfiles) {
console.log("writing sources");
+for (const source of allSources) {
+ for (let key in source) {
+ const value = source[key];
+ if (typeof value === "string" && value.includes("\\"))
+ source[key] = source[key].replace(/\\/gm, "/");
+ else if (Array.isArray(value)) {
+ value.forEach((elem, index) => {
+ value[index] = elem.replace(/\\/gm, "/");
+ });
+ }
+ }
+}
+
await fs.writeFile(
"generated-sources.json",
JSON.stringify(allSources, undefined, 4)
);
-console.log("done");
\ No newline at end of file
+console.log("done");