Skip to content

Commit

Permalink
fix [Bug]: 安装的软件包如果未启用,重启服务后, 软件包列表未能显示此软件包 #5942
Browse files Browse the repository at this point in the history
  • Loading branch information
baozhoutao committed Dec 7, 2023
1 parent aef2632 commit 3310a44
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions services/service-package-registry/project.package.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,11 @@ module.exports = {
},
getPackageInfo: {
handler(packageInfo, packageName){
const packageJson = require(`${_path}/package.json`);
let packagePath = packageInfo.path || path.dirname(require.resolve(`${packageName}/package.json`));
if(!path.isAbsolute(packagePath)){
packagePath = path.resolve(process.cwd(), packagePath)
}
const packageJson = require(`${packagePath}/package.json`);
return {
version: packageJson.version,
description: packageJson.description,
Expand All @@ -488,7 +492,7 @@ module.exports = {
//注册本地已安装的steedos packages
const installPackages = loader.loadPackagesConfig();
for (const name in installPackages) {
if (Object.hasOwnProperty.call(installPackages, name) && (packageName && packageName === name)) {
if (Object.hasOwnProperty.call(installPackages, name) && (packageName && packageName === name || !packageName)) {
let _packageInfo = installPackages[name];
if(_packageInfo.static){
_packageInfo = Object.assign({}, _packageInfo, this.getStaticPackageInfo(_packageInfo, name))
Expand Down

0 comments on commit 3310a44

Please sign in to comment.