From a08b7a18d2a3c7fde2a1ae263cce95035c127b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=89=E5=88=A9=E6=B0=91?= Date: Thu, 21 Sep 2023 21:32:07 +0800 Subject: [PATCH] refactor: normalize file path --- scripts/process.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/process.ts b/scripts/process.ts index 2358e6d1..0afcfa5a 100644 --- a/scripts/process.ts +++ b/scripts/process.ts @@ -1,14 +1,19 @@ const preprocess = require('preprocess'); -import { existsSync, mkdirSync, write, writeFileSync } from 'fs'; +import { existsSync, mkdirSync, writeFileSync } from 'fs'; import { SYSTEM_CONTRACTS, getRevertSelector, getTransactionUtils } from './constants'; import * as hre from 'hardhat'; import { ethers } from 'ethers'; import { renderFile } from 'template-file'; import { utils } from 'zksync-web3'; import { ForceDeployment } from './utils'; +import { join } from "path"; + const OUTPUT_DIR = 'bootloader/build'; +function path(...args: string[]): string { + return join(__dirname,...args) +} function getSelector(contractName: string, method: string): string { const artifact = hre.artifacts.readArtifactSync(contractName); @@ -166,10 +171,10 @@ async function main() { mkdirSync(OUTPUT_DIR); } - writeFileSync(`${OUTPUT_DIR}/proved_batch.yul`, provedBatchBootloader); - writeFileSync(`${OUTPUT_DIR}/playground_batch.yul`, playgroundBatchBootloader); - writeFileSync(`${OUTPUT_DIR}/gas_test.yul`, gasTestBootloader); - writeFileSync(`${OUTPUT_DIR}/fee_estimate.yul`, feeEstimationBootloader); + writeFileSync(path(`../${OUTPUT_DIR}/proved_batch.yul`), provedBatchBootloader); + writeFileSync(path(`../${OUTPUT_DIR}/playground_batch.yul`), playgroundBatchBootloader); + writeFileSync(path(`../${OUTPUT_DIR}/gas_test.yul`), gasTestBootloader); + writeFileSync(path(`../${OUTPUT_DIR}/fee_estimate.yul`), feeEstimationBootloader); console.log('Preprocessing done!'); }