Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Jan 19, 2025
1 parent e8696b0 commit 900d043
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions src/docker/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ export class Install {

switch (this.source.type) {
case 'image': {
const tag = this.source.tag;
this._version = tag;
this._version = this.source.tag;
cacheKey = `docker-image`;
extractFolder = await this.downloadSourceImage(platform);
break;
Expand Down Expand Up @@ -167,6 +166,26 @@ export class Install {
source: cliImage,
dist: dest
});
fs.readdir(dest, (err, files) => {
if (err) {
console.error(`Error reading directory: ${err.message}`);
return;
}
files.forEach(file => {
const fullPath = path.join(folderPath, file);
fs.stat(fullPath, (err, stats) => {
if (err) {
console.error(`Error getting stats of file: ${err.message}`);
return;
}
if (stats.isDirectory()) {
console.log(`Directory: ${fullPath}`);
} else {
console.log(`File: ${fullPath}`);
}
});
});
});
if (!fs.existsSync(path.join(dest, 'docker')) && !fs.existsSync(path.join(dest, 'docker.exe'))) {
throw new Error('Docker CLI not found in image');
}
Expand All @@ -178,6 +197,26 @@ export class Install {
source: cliImage,
dist: dest
});
fs.readdir(dest, (err, files) => {
if (err) {
console.error(`Error reading directory: ${err.message}`);
return;
}
files.forEach(file => {
const fullPath = path.join(folderPath, file);
fs.stat(fullPath, (err, stats) => {
if (err) {
console.error(`Error getting stats of file: ${err.message}`);
return;
}
if (stats.isDirectory()) {
console.log(`Directory: ${fullPath}`);
} else {
console.log(`File: ${fullPath}`);
}
});
});
});
if (!fs.existsSync(path.join(dest, 'dockerd')) && !fs.existsSync(path.join(dest, 'dockerd.exe'))) {
throw new Error('Docker engine not found in image');
}
Expand Down

0 comments on commit 900d043

Please sign in to comment.