🌳
pt0/serverF/ptDiskF/ptDiskF.mts
1import { pathDownJoin } from '../pathF.mts'
4import type { absFileDirPath } from '../../ptDirF.mts'
6export const prodPtDiskMntName = 'ptdisk'
7export const prodPtDiskDir = `/${prodPtDiskMntName}` as absFileDirPath
9export const ptDiskDir = (
10 isDevPc ? pathDownJoin(envHome!, prodPtDiskMntName) : prodPtDiskDir
13export const ptTmpDir = pathDownJoin(ptDiskDir, 'tmp')
15export const ensurePtDiskDirExists = async () => {
16 await mkDirUnlessExist(ptDiskDir)
19export const ensureTmpDirExists = async (subdirName?: string) => {
20 await ensurePtDiskDirExists()
21 await mkDirUnlessExist(ptTmpDir)
22 if (subdirName) {
23 const path = pathDownJoin(ptTmpDir, subdirName)
24 await mkDirUnlessExist(path)
25 return path
26 }
27 return ptTmpDir