Skip to content

Commit

Permalink
Update Pixlet to 0.28.4 and Ubuntu to 20.04.6 (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
avidNewb authored Oct 7, 2023
1 parent 7517543 commit 9bb87e8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
13 changes: 6 additions & 7 deletions functions/axilla/axilla.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const RESERVERD_PARAMS = [
'format',
'output',
'applet',
'version',
'version'
]

const FORMATS = {
Expand All @@ -35,7 +35,7 @@ const LD_LIBRARY_PATH = process.env.LD_LIBRARY_PATH
/* eslint-enable prefer-destructuring */

// static paths
const TMP_PATH = '/tmp'
const TMP_PATH = '/tmp/'
const ASSETS_PATH = path.join(__dirname, 'assets')
const DEFAULT_APPLET_PATH = path.join(ASSETS_PATH, 'default.star')
const INPUT_APPLET_PATH = path.join(TMP_PATH, 'input.star')
Expand Down Expand Up @@ -131,15 +131,14 @@ exports.handler = async (event) => {
}

// base64 encode the generated image
let imageBase64
try {
imageBase64 = await fs.readFile(outputPath, 'base64')
} catch (error) {
const imageBase64 = await fs.readFile(outputPath, 'base64', function(err, data){
if (err) {
return {
statusCode: 500,
body: `Error: Could not read output file. ${error.message}`,
body: `Error: Could not read output file. ${error.message} ${outputPath}`,
}
}
});

// delete the temp input and output files
try { await fs.unlink(INPUT_APPLET_PATH) } catch (error) { /* noop */ }
Expand Down
File renamed without changes.
Binary file modified functions/axilla/pixlet/pixlet-aws
100755 → 100644
Binary file not shown.
1 change: 1 addition & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@

[functions]
directory = "functions"
included_files = ["functions/**"]

0 comments on commit 9bb87e8

Please sign in to comment.