Skip to content

Commit

Permalink
fix(docker): get images before get pull
Browse files Browse the repository at this point in the history
  • Loading branch information
koromerzhin committed Dec 19, 2022
1 parent fbd1cfc commit 8d9fae1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function getInfoContainers(data, length, sleep)
});
}

async function getImagesLocal()
async function getImagesLocal(status)
{
await docker.listImages().then(images => {
images.forEach(image => {
Expand All @@ -48,8 +48,10 @@ async function getImagesLocal()
}
})
});
console.log('Images in local');
console.table(imagesData);
if (status == 1) {
console.log('Images in local');
console.table(imagesData);
}
}

function execShellCommand(cmd) {
Expand Down Expand Up @@ -115,13 +117,14 @@ program.command('waiting')
program.command('getlocal-image')
.description('get local image')
.action(() => {
getImagesLocal();
getImagesLocal(1);
});

program.command('getpull-image')
.description('get pull image')
.argument('<string>', 'File docker-compose.yml')
.action(async (str) => {
await getImagesLocal(0);
await readDockerCompose(str);
});

Expand Down

0 comments on commit 8d9fae1

Please sign in to comment.