From e83401a49af043f790a5e714f928187ea6eb21d2 Mon Sep 17 00:00:00 2001 From: ZacharyShortSecurrency Date: Sun, 17 Sep 2023 15:13:24 -0500 Subject: [PATCH] Restore post-install.js --- post-install.js | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/post-install.js b/post-install.js index 61728b2..ffcc982 100644 --- a/post-install.js +++ b/post-install.js @@ -1,23 +1,15 @@ const fs = require('fs'); -function runModifyBuffer( path ) { +try { + const nativeStrategyPath = require.resolve("@truffle/compile-solidity/dist/compilerSupplier/loadingStrategies/Native.js"); + const maxBuffer = '1024 * 1024 * 50'; const maxBufferRequired = '1024 * 1024 * 1024'; - const nativeStrategy = fs.readFileSync(path, 'utf8'); + const nativeStrategy = fs.readFileSync(nativeStrategyPath, 'utf8'); const modifiedNativeStrategy = nativeStrategy.replace(maxBuffer, maxBufferRequired); - fs.writeFileSync(path, modifiedNativeStrategy); -} - -let nativeStrategyPath = require.resolve("@truffle/compile-solidity/dist/compilerSupplier/loadingStrategies/Native.js"); - -if (fs.existsSync(nativeStrategyPath)) { - return runModifyBuffer(nativeStrategyPath); -} - -nativeStrategyPath = '../@truffle/compile-solidity/dist/compilerSupplier/loadingStrategies/Native.js'; - -if (fs.existsSync(nativeStrategyPath)) { - return runModifyBuffer(nativeStrategyPath); -} + fs.writeFileSync(nativeStrategyPath, modifiedNativeStrategy); +} catch (e) { + console.info(e); +} \ No newline at end of file