Port onigasm fix for PHP
This commit is contained in:
parent
14a0cd3ffd
commit
cc7585bbc2
@ -341,19 +341,25 @@ class Builder {
|
|||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: fix onigasm dep
|
// onigasm 2.2.2 has a bug that makes it broken for PHP files so use 2.2.1.
|
||||||
// # onigasm 2.2.2 has a bug that makes it broken for PHP files so use 2.2.1.
|
// https://github.com/NeekSandhu/onigasm/issues/17
|
||||||
// # https://github.com/NeekSandhu/onigasm/issues/17
|
await this.task("Applying onigasm PHP fix", async () => {
|
||||||
// function fix-onigasm() {
|
const onigasmPath = path.join(finalBuildPath, "node_modules/onigasm-umd");
|
||||||
// local onigasmPath="${buildPath}/node_modules/onigasm-umd"
|
const onigasmTmpPath = `${onigasmPath}-temp`;
|
||||||
// rm -rf "${onigasmPath}"
|
await Promise.all([
|
||||||
// git clone "https://github.com/alexandrudima/onigasm-umd" "${onigasmPath}"
|
fs.remove(onigasmPath),
|
||||||
// cd "${onigasmPath}" && yarn && yarn add --dev onigasm@2.2.1 && yarn package
|
fs.mkdir(onigasmTmpPath),
|
||||||
// mkdir "${onigasmPath}-temp"
|
]);
|
||||||
// mv "${onigasmPath}/"{release,LICENSE} "${onigasmPath}-temp"
|
await util.promisify(cp.exec)(`git clone "https://github.com/alexandrudima/onigasm-umd" "${onigasmPath}"`);
|
||||||
// rm -rf "${onigasmPath}"
|
await util.promisify(cp.exec)("yarn", { cwd: onigasmPath });
|
||||||
// mv "${onigasmPath}-temp" "${onigasmPath}"
|
await util.promisify(cp.exec)("yarn add --dev onigasm@2.2.1", { cwd: onigasmPath });
|
||||||
// }
|
await util.promisify(cp.exec)("yarn package", { cwd: onigasmPath });
|
||||||
|
await Promise.all(["release", "LICENSE", "package.json"].map((fileName) => {
|
||||||
|
return fs.copy(path.join(onigasmPath, fileName), path.join(onigasmTmpPath, fileName));
|
||||||
|
}));
|
||||||
|
await fs.remove(onigasmPath);
|
||||||
|
await fs.move(onigasmTmpPath, onigasmPath);
|
||||||
|
});
|
||||||
|
|
||||||
this.log(`Final build: ${finalBuildPath}`);
|
this.log(`Final build: ${finalBuildPath}`);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user