File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import Web3 from "web3";
1515import { CHAINS } from "@pythnetwork/xc-admin-common" ;
1616import * as fs from "fs" ;
1717
18- const { getDefaultConfig } = require ( "./contractManagerConfig" ) ;
18+ const { getDefaultConfig } = require ( "../../target_chains/ethereum/contracts/scripts /contractManagerConfig" ) ;
1919
2020const parser = yargs ( hideBin ( process . argv ) )
2121 . usage (
@@ -46,7 +46,14 @@ const parser = yargs(hideBin(process.argv))
4646 } ) ;
4747
4848async function memoize ( key : string , fn : ( ) => Promise < any > ) {
49- const path = `./cache/${ key } .json` ;
49+ const cacheDir = './cache' ;
50+ const path = `${ cacheDir } /${ key } .json` ;
51+
52+ // Ensure cache directory exists
53+ if ( ! fs . existsSync ( cacheDir ) ) {
54+ fs . mkdirSync ( cacheDir , { recursive : true } ) ;
55+ }
56+
5057 if ( fs . existsSync ( path ) ) {
5158 return JSON . parse ( fs . readFileSync ( path ) . toString ( ) ) ;
5259 }
You can’t perform that action at this time.
0 commit comments