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 #16 from Into-the-Fathom/dev
Browse files Browse the repository at this point in the history
1.2.1
  • Loading branch information
TonioMacaronio authored Sep 19, 2023
2 parents 41233aa + e2db429 commit 283bb0e
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 283bb0e

Please sign in to comment.