add route for app module micro

This commit is contained in:
2024-11-23 23:52:21 +08:00
parent f94c9323b4
commit 01680b39c2
11 changed files with 216 additions and 19 deletions

View File

@@ -11,7 +11,12 @@ export type InstallAppOpts = {
path?: string;
key?: string;
};
export const appCheck = async (opts: InstallAppOpts) => {
/**
* 检测路径是否存在
* @param opts
* @returns
*/
export const appPathCheck = async (opts: InstallAppOpts) => {
const { key } = opts;
const directory = path.join(appsPath, key);
if (fileIsExist(directory)) {
@@ -55,7 +60,5 @@ export const installApp = async (opts: InstallAppOpts) => {
app.key = key;
fs.writeFileSync(pkgs, JSON.stringify(pkg, null, 2));
// fs.unlinkSync(filePath);
return { path: filePath };
return { path: filePath, pkg };
};