mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
write file fix
This commit is contained in:
parent
9665db7bbe
commit
0fea32c204
1 changed files with 3 additions and 6 deletions
|
@ -48,6 +48,7 @@ import logger from '../utils/logger'
|
|||
|
||||
import { paths } from './files'
|
||||
import { Request } from '../types/basicTypes'
|
||||
import path from 'node:path'
|
||||
|
||||
interface URLFormatOptions {
|
||||
pathname?: string
|
||||
|
@ -151,12 +152,8 @@ function WatchFile(file: string, callback: Function): void {
|
|||
}
|
||||
}
|
||||
|
||||
function createDirsForFile(path: string): void {
|
||||
let pathPart = path
|
||||
if (pathPart.endsWith('/')) {
|
||||
pathPart = pathPart.slice(0, -1)
|
||||
}
|
||||
pathPart = path.split('/').slice(0, -1).join('/')
|
||||
function createDirsForFile(dir: string): void {
|
||||
const pathPart = path.dirname(dir)
|
||||
CreatePath(pathPart)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue