Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #15 from Securrency-OSS/dev
Browse files Browse the repository at this point in the history
Merge origin dev changes
  • Loading branch information
TonioMacaronio authored Sep 19, 2023
2 parents cb89bf8 + 9d4102b commit e2db429
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions post-install.js
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit e2db429

Please sign in to comment.