fix: 更新部署
This commit is contained in:
@@ -57,8 +57,25 @@ export const installApp = async (opts: InstallAppOpts) => {
|
||||
if (!name || !version || !app) {
|
||||
throw new Error('Invalid package.json');
|
||||
}
|
||||
|
||||
const readmeFile = path.join(extractPath, 'README.md');
|
||||
let readmeDesc = '';
|
||||
if (fileIsExist(readmeFile)) {
|
||||
readmeDesc = fs.readFileSync(readmeFile, 'utf-8');
|
||||
}
|
||||
let showAppInfo = {
|
||||
key,
|
||||
status: 'inactive',
|
||||
type: app?.type || 'system-app',
|
||||
description: readmeDesc || '',
|
||||
version,
|
||||
//
|
||||
entry: app?.entry || '',
|
||||
path: extractPath,
|
||||
origin: app,
|
||||
};
|
||||
app.key = key;
|
||||
fs.writeFileSync(pkgs, JSON.stringify(pkg, null, 2));
|
||||
// fs.unlinkSync(filePath);
|
||||
return { path: filePath, pkg };
|
||||
return { path: filePath, pkg, showAppInfo };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user