From ff7461496093c359b6fe42c42f7da8b5d532dae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=89=E5=88=A9=E6=B0=91?= Date: Wed, 20 Sep 2023 23:23:10 +0800 Subject: [PATCH] refactor: normalize file path --- etc/system-contracts/scripts/process.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/etc/system-contracts/scripts/process.ts b/etc/system-contracts/scripts/process.ts index 09082189..87e3547d 100644 --- a/etc/system-contracts/scripts/process.ts +++ b/etc/system-contracts/scripts/process.ts @@ -5,6 +5,11 @@ import { getRevertSelector, getTransactionUtils } from './constants'; import * as hre from 'hardhat'; import { ethers } from 'ethers'; import { renderFile } from 'template-file'; +import { join } from "path"; + +function path(...args: string[]): string { + return join(__dirname,...args) +} const OUTPUT_DIR = 'bootloader/build'; @@ -113,11 +118,11 @@ async function main() { if(!existsSync(OUTPUT_DIR)) { mkdirSync(OUTPUT_DIR); } - - writeFileSync(`${OUTPUT_DIR}/proved_block.yul`, provedBlockBootloader); - writeFileSync(`${OUTPUT_DIR}/playground_block.yul`, playgroundBlockBootloader); - writeFileSync(`${OUTPUT_DIR}/gas_test.yul`, gasTestBootloader); - writeFileSync(`${OUTPUT_DIR}/fee_estimate.yul`, feeEstimationBootloader); + + writeFileSync(path(`../${OUTPUT_DIR}/proved_block.yul`) , provedBlockBootloader); + writeFileSync(path(`../${OUTPUT_DIR}/playground_block.yul`), playgroundBlockBootloader); + writeFileSync(path(`../${OUTPUT_DIR}/gas_test.yul`), gasTestBootloader); + writeFileSync(path(`../${OUTPUT_DIR}/fee_estimate.yul`), feeEstimationBootloader); console.log('Preprocessing done!'); }