Skip to content

Commit

Permalink
fix: 修正本地存储目录创建
Browse files Browse the repository at this point in the history
  • Loading branch information
bangbang93 committed May 20, 2024
1 parent 303ca97 commit 0a4c744
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/storage/file.storage.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Bluebird from 'bluebird'
import colors from 'colors/safe.js'
import type {Request, Response} from 'express'
import fse from 'fs-extra'
import {access, readdir, rm, stat, unlink, writeFile} from 'fs/promises'
import fse, {mkdirp} from 'fs-extra'
import {readdir, rm, stat, unlink, writeFile} from 'fs/promises'
import {min} from 'lodash-es'
import {join, sep} from 'path'
import {logger} from '../logger.js'
Expand All @@ -15,7 +15,7 @@ export class FileStorage implements IStorage {

public async check(): Promise<boolean> {
try {
await access(this.cacheDir)
await mkdirp(this.cacheDir)
await writeFile(join(this.cacheDir, '.check'), '')
return true
} catch (e) {
Expand Down

0 comments on commit 0a4c744

Please sign in to comment.