This commit is contained in:
Rizky 2024-09-02 14:54:05 +07:00
parent c920be9bf9
commit cc38f2cab4
1 changed files with 12 additions and 8 deletions

View File

@ -11,6 +11,7 @@ import { exists } from "fs-jetpack";
export const code = { export const code = {
internal: codeInternal, internal: codeInternal,
async init(id_site: string, note: string) { async init(id_site: string, note: string) {
try {
const root = `/code/${id_site}/site/src`; const root = `/code/${id_site}/site/src`;
await ensureLib(root, id_site); await ensureLib(root, id_site);
@ -22,6 +23,9 @@ export const code = {
if (exists(dir.data(`${root}`))) { if (exists(dir.data(`${root}`))) {
await $`chmod -R 777 ${dir.data(`${root}`)}`; await $`chmod -R 777 ${dir.data(`${root}`)}`;
} }
} catch (e) {
console.error(`Failed to init site: ${id_site}`);
}
}, },
path( path(
id_site: string, id_site: string,