Skip to content

Commit

Permalink
Fix logger
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrze committed Oct 13, 2023
1 parent de82a3e commit 778feea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
7 changes: 1 addition & 6 deletions bin/pos-cli-modules-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const { resolveDependencies } = require('../lib/modules/dependencies')
const readLocalModules = () => {
const modulesConfigFileName = `pos-modules.json`;
const config = files.readJSON(modulesConfigFileName, { throwDoesNotExistError: true });
console.log('config', config);
return config['modules'];
};

Expand All @@ -33,9 +32,6 @@ program

progress.__moduleInfo = spinner.start('Loading module version info');
const localModules = readLocalModules();
// const rootModules = Object.keys(localModules);
// console.log('rootModules', rootModules);

logger.Info('Resolving module dependencies', { hideTimestamp: true })
lock['modules'] = await resolveDependencies(localModules, (list) => gateway.getModuleVersions(list));

Expand All @@ -45,9 +41,8 @@ program
} else {
fs.writeFileSync(path.join(process.cwd(), 'pos-modules.lock.json'), JSON.stringify(lock, null, 2));
logger.Info('Modules lock file created');
progress.__moduleInfo.succeed(`Modules installed`);
}
});

program.parse(process.argv);

// moduleVersions = await gateway.getModuleVersions(rootModules);
1 change: 1 addition & 0 deletions lib/modules/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const resolveDependencies = async (modules, getVersions) => {
const dependenciesList = flatten(
modulesVersions.map(module => {
const version = module.versions[modules[module.module]];
if(!version) throw new Error(`Can't find any version for module ${module.module}`);

return Object.entries(version.dependencies).map(dependency=> {
const [dependencyName, dependencyVersion] = dependency;
Expand Down

0 comments on commit 778feea

Please sign in to comment.