Skip to content

Commit 4ee5cd5

Browse files
authored
Merge pull request #2133 from oracle-devrel/ci-nginx-with-volumes-example-filesystem-fix
filesystem mount fix for images
2 parents f4bcd76 + 95cb384 commit 4ee5cd5

File tree

1 file changed

+17
-9
lines changed
  • app-dev/devops-and-containers/container-instances/ci-nginx-with-volumes-example/files/source

1 file changed

+17
-9
lines changed

app-dev/devops-and-containers/container-instances/ci-nginx-with-volumes-example/files/source/index.js

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,23 @@ async function downloadFile(osClient, namespace, bucket, file, path)
9090
chunks.push(chunk);
9191
}
9292
var buffer = Buffer.concat(chunks);
93-
//console.log(buffer.toString());
94-
console.log(path + "/" + file.name);
95-
await fs.writeFile(path + "/" + file.name, buffer.toString(), 'utf8', (err) => {
96-
if (err) {
97-
console.log('Error writing file:', err);
98-
return;
99-
}
100-
console.log('File written to' + path + "/" + file.name);
101-
});
93+
if(file.name.indexOf(".htm") > 0) {
94+
await fs.writeFile(path + "/" + file.name, buffer.toString(), 'utf8', (err) => {
95+
if (err) {
96+
console.log('Error writing file:', err);
97+
return;
98+
}
99+
console.log('File written successfully to' + path + "/" + file.name);
100+
});
101+
} else {
102+
await fs.writeFile(path + "/" + file.name, buffer, null, (err) => {
103+
if (err) {
104+
console.log('Error writing file:', err);
105+
return;
106+
}
107+
console.log('File written successfully to' + path + "/" + file.name);
108+
});
109+
}
102110
}
103111
}
104112

0 commit comments

Comments
 (0)