forked from gchq/CyberChef-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpostinstall.js
More file actions
26 lines (23 loc) · 1.2 KB
/
postinstall.js
File metadata and controls
26 lines (23 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { exec } from "node:child_process";
switch (process.platform) {
case "darwin":
exec("find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i '' -e '/\\.mjs/!s/\\(from \"\\.[^\"]*\\)\";/\\1.mjs\";/g'");
break;
default:
exec("find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i -e '/\\.mjs/!s/\\(from \"\\.[^\"]*\\)\";/\\1.mjs\";/g'");
}
switch (process.platform) {
case "darwin":
exec("sed -i '' 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js");
break;
default:
exec("sed -i 's/<div id=snackbar-container\\/>/<div id=snackbar-container>/g' ./node_modules/snackbarjs/src/snackbar.js");
}
switch (process.platform) {
case "darwin":
// Space added before comma to prevent multiple modifications
exec("sed -i '' 's/\"es\\/index.js\",/\"es\\/index.js\" ,\\n \"type\": \"module\",/' ./node_modules/jimp/package.json");
break;
default:
exec("sed -i 's/\"es\\/index.js\",/\"es\\/index.js\" ,\\n \"type\": \"module\",/' ./node_modules/jimp/package.json");
}