austinried b7a05ca955 impl cache create/delete with server create/delete
also impl test connection
2021-08-18 12:11:44 +09:00

20 lines
455 B
TypeScript

import RNFS from 'react-native-fs'
export async function mkdir(path: string): Promise<void> {
const exists = await RNFS.exists(path)
if (exists) {
const isDir = (await RNFS.stat(path)).isDirectory()
if (!isDir) {
throw new Error(`path exists and is not a directory: ${path}`)
} else {
return
}
}
return await RNFS.mkdir(path)
}
export async function rmdir(path: string): Promise<void> {
return RNFS.unlink(path)
}