mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
chore: Remove support for deprecated Excalidraw for Desktop (#2465)
This commit is contained in:
parent
fb582b45db
commit
10e07e434c
4 changed files with 19 additions and 38 deletions
|
@ -2,7 +2,8 @@
|
|||
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const asar = require("asar");
|
||||
const versionFile = path.join("build", "version.json");
|
||||
const indexFile = path.join("build", "index.html");
|
||||
|
||||
const zero = (digit) => `0${digit}`.slice(-2);
|
||||
|
||||
|
@ -20,18 +21,24 @@ const now = new Date();
|
|||
|
||||
const data = JSON.stringify(
|
||||
{
|
||||
asar: "excalidraw.asar",
|
||||
version: versionDate(now),
|
||||
},
|
||||
undefined,
|
||||
2,
|
||||
);
|
||||
|
||||
fs.writeFileSync(path.join("build", "version.json"), data);
|
||||
fs.writeFileSync(versionFile, data);
|
||||
|
||||
(async () => {
|
||||
const src = "build/";
|
||||
const dest = path.join("build", `excalidraw.asar`);
|
||||
// https://stackoverflow.com/a/14181136/8418
|
||||
fs.readFile(indexFile, "utf8", (error, data) => {
|
||||
if (error) {
|
||||
return console.error(error);
|
||||
}
|
||||
const result = data.replace(/{version}/g, versionDate(now));
|
||||
|
||||
await asar.createPackage(src, dest);
|
||||
})();
|
||||
fs.writeFile(indexFile, result, "utf8", (error) => {
|
||||
if (error) {
|
||||
return console.error(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue