rename sites to manager

This commit is contained in:
lightling 2024-11-06 17:14:31 -05:00
parent 5e866ca8d2
commit ed025533cd
Signed by: lightling
GPG key ID: F1F29650D537C773
11 changed files with 15 additions and 15 deletions

View file

@ -1,10 +1,10 @@
import { existsSync } from 'fs';
import { readFile } from 'fs/promises';
import { setCurrent } from '../sites/src/set-current.js'
import { setCurrent } from '../manager/src/set-current.js'
(async () => {
if (existsSync('../sites/sites/current.txt')) {
const site = await readFile('../sites/sites/current.txt', { encoding: 'utf-8' });
if (existsSync('../manager/sites/current.txt')) {
const site = await readFile('../manager/sites/current.txt', { encoding: 'utf-8' });
setCurrent(site);
}
})();

View file

@ -1,5 +1,5 @@
{
"name": "sites",
"name": "manager",
"private": true,
"version": "0.0.0",
"type": "module",

View file

@ -3,7 +3,7 @@ import { existsSync } from 'fs';
import { mkdir, unlink, writeFile } from 'fs/promises';
export const setCurrent = async (site, ctx) => {
const managerPath = ctx?.managerPath || '../sites';
const managerPath = ctx?.managerPath || '../manager';
const frontendPath = ctx?.frontendPath || '../frontend';
if (!!site) {
await symlinkDir(`${managerPath}/sites/${site}`, `${frontendPath}/content`);