Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DanMittendorf opened this issue Aug 11, 2023 · 0 comments
Assignees

Comments

@DanMittendorf
Copy link

DanMittendorf commented Aug 11, 2023

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))
@aszk aszk self-assigned this Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants