Skip to content

Code sample not running in a Lambda function due to read-only filesystem #2

@DanMittendorf

Description

@DanMittendorf

The code needs to be changed in 12 places to save and extract files from /tmp/

Line 152
zip.extractAllTo('/tmp/extracted', true);

Line 162
const fileData = fs.readFileSync('/tmp/'+SKILL_PACKAGE_ZIP);

Line 168
'Content-Length': fs.statSync('/tmp/'+SKILL_PACKAGE_ZIP).size

Line 186-187

zip.addLocalFolder('/tmp/extracted');
zip.writeZip('/tmp/'+SKILL_PACKAGE_ZIP);

Line 206-210

if (!fs.existsSync('/tmp/downloaded')) {
fs.mkdirSync('/tmp/downloaded');
}
if (!fs.existsSync('/tmp/extracted')) {
fs.mkdirSync('/tmp/extracted');

Line 220

await downloadSkillPackage(packageDownloadUrl, '/tmp/downloaded/skillPackage.zip');`

Line 257

const interactionModel = readJsonFile(`/tmp/extracted/interactionModels/custom/${locale}.json`);

Line 266

fs.writeFileSync(`/tmp/extracted/interactionModels/custom/${locale}.json`, JSON.stringify(interactionModel, null, 2))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions