mirror of
https://github.com/gchq/CyberChef
synced 2024-11-15 00:57:08 +00:00
Use process.platform to detect OS during postinstall
This commit is contained in:
parent
2efd075803
commit
4e747b3697
1 changed files with 8 additions and 7 deletions
15
Gruntfile.js
15
Gruntfile.js
|
@ -390,13 +390,14 @@ module.exports = function (grunt) {
|
|||
stdout: false,
|
||||
},
|
||||
fixCryptoApiImports: {
|
||||
command: [
|
||||
`[[ "$OSTYPE" == "darwin"* ]]`,
|
||||
"&&",
|
||||
`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'`,
|
||||
"||",
|
||||
`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'`
|
||||
].join(" "),
|
||||
command: function () {
|
||||
switch (process.platform) {
|
||||
case "darwin":
|
||||
return `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'`;
|
||||
default:
|
||||
return `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'`;
|
||||
}
|
||||
},
|
||||
stdout: false
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue