feat: add vite dev containers
This commit is contained in:
@@ -2,12 +2,23 @@ import os from 'os';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
|
||||
const envisionPath = path.join(os.homedir(), '.config', 'envision');
|
||||
export const envisionPath = path.join(os.homedir(), '.config', 'envision');
|
||||
const configPath = path.join(os.homedir(), '.config', 'envision', 'config.json');
|
||||
|
||||
export const pidFilePath = path.join(envisionPath, 'app.pid');
|
||||
export const dbPath = path.join(envisionPath, 'db.sqlite');
|
||||
|
||||
const envisionPidDir = path.join(envisionPath);
|
||||
export const getPidList = () => {
|
||||
const files = fs.readdirSync(envisionPidDir);
|
||||
const pidFiles = files.filter((file) => file.endsWith('.pid'));
|
||||
return pidFiles.map((file) => {
|
||||
const pid = fs.readFileSync(path.join(envisionPidDir, file), 'utf-8');
|
||||
return { pid, file: path.join(envisionPidDir, file) };
|
||||
});
|
||||
};
|
||||
export const writeVitePid = (pid: number) => {
|
||||
fs.writeFileSync(path.join(envisionPath, `vite-${pid}.pid`), pid.toString());
|
||||
};
|
||||
export const checkFileExists = (filePath: string) => {
|
||||
try {
|
||||
fs.accessSync(filePath, fs.constants.F_OK);
|
||||
|
||||
Reference in New Issue
Block a user