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 #11 from Securrency-OSS/dev
Browse files Browse the repository at this point in the history
Origin updates
  • Loading branch information
TonioMacaronio authored Sep 7, 2023
2 parents 28a5f86 + 666a453 commit 6c4539d
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions post-install.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
const fs = require('fs');

try {
const nativeStrategyPath = require.resolve("@truffle/compile-solidity/dist/compilerSupplier/loadingStrategies/Native.js");

function runModifyBuffer( path ) {
const maxBuffer = '1024 * 1024 * 50';
const maxBufferRequired = '1024 * 1024 * 1024';

const nativeStrategy = fs.readFileSync(nativeStrategyPath, 'utf8');
const nativeStrategy = fs.readFileSync(path, 'utf8');
const modifiedNativeStrategy = nativeStrategy.replace(maxBuffer, maxBufferRequired);

fs.writeFileSync(nativeStrategyPath, modifiedNativeStrategy);
} catch (e) {
console.info(e);
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);
}

0 comments on commit 6c4539d

Please sign in to comment.