Skip to content

Commit

Permalink
fix: create node cache directory with permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriyaga-txfusion committed Feb 27, 2025
1 parent e306b8c commit ea635fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/hardhat-zksync-node/src/downloader.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import fse from 'fs-extra';
import chalk from 'chalk';
import { download, getAllTags, getLatestRelease, getNodeUrl, resolveTag } from './utils';
import { download, ensureDirectory, getAllTags, getLatestRelease, getNodeUrl, resolveTag } from './utils';
import { ZkSyncNodePluginError } from './errors';
import {
DEFAULT_RELEASE_CACHE_FILE_NAME,
Expand Down Expand Up @@ -130,6 +130,7 @@ export class RPCServerDownloader {
USER_AGENT,
DEFAULT_TIMEOUT_MILISECONDS,
);
await ensureDirectory(this._tagsInfoFilePath, { mode: 0o755 });
await fse.writeJSON(this._tagsInfoFilePath, { tags: allTags, latest: latestTag });
}
}
4 changes: 2 additions & 2 deletions packages/hardhat-zksync-node/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ function ensureTarGzExtension(filePath: string): string {
return filePath.endsWith('.tar.gz') ? filePath : `${filePath}.tar.gz`;
}

async function ensureDirectory(filePath: string): Promise<void> {
await fse.ensureDir(path.dirname(filePath));
export async function ensureDirectory(filePath: string, options?: { mode: any }): Promise<void> {
await fse.ensureDir(path.dirname(filePath), options);
}

async function moveFile(sourcePath: string, destinationPath: string): Promise<void> {
Expand Down

0 comments on commit ea635fd

Please sign in to comment.