Create vault dir if doesn't exist
This commit is contained in:
parent
92b8a966be
commit
8783194ffc
1 changed files with 5 additions and 1 deletions
|
|
@ -39,6 +39,10 @@ async function main(): Promise<void> {
|
||||||
const args = parseArgs(process.argv);
|
const args = parseArgs(process.argv);
|
||||||
const absolutePath = path.resolve(args.localPath);
|
const absolutePath = path.resolve(args.localPath);
|
||||||
|
|
||||||
|
if (!fsSync.existsSync(absolutePath)) {
|
||||||
|
fsSync.mkdirSync(absolutePath, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const stats = await fs.stat(absolutePath);
|
const stats = await fs.stat(absolutePath);
|
||||||
if (!stats.isDirectory()) {
|
if (!stats.isDirectory()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue