From 03950591386b0ce84696cbd85a01f33e8e3c9d52 Mon Sep 17 00:00:00 2001 From: Rizky Date: Sat, 11 May 2024 07:05:07 +0700 Subject: [PATCH] fix --- app/srv/ws/sync/code/code.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/srv/ws/sync/code/code.ts b/app/srv/ws/sync/code/code.ts index fcb2b5e7..4f67a4ab 100644 --- a/app/srv/ws/sync/code/code.ts +++ b/app/srv/ws/sync/code/code.ts @@ -6,7 +6,7 @@ import { ensureFiles } from "./utlis/ensure-files"; import { ensureLib } from "./utlis/ensure-lib"; import { initTypings } from "./parts/init/typings"; import { $ } from "bun"; - +import { exists } from "fs-jetpack"; export const code = { internal: codeInternal, async init(id_site: string, note: string) { @@ -18,7 +18,9 @@ export const code = { await initFrontEnd(root, id_site); await initServer(root, id_site); await initTypings(root, id_site); - await $`chmod -R 777 ${root}/typings`; + if (exists(dir.data(`${root}/typings`))) { + await $`chmod -R 777 ${dir.data(`${root}/typings`)}`; + } }, path( id_site: string,