Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
38 lines (30 loc) · 1.12 KB

File metadata and controls

38 lines (30 loc) · 1.12 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
const fs = require('fs')
const { execSync } = require('child_process')
const AWS = require('aws-sdk')
const s3 = new AWS.S3()
// Depends on tar-find-layer for the tar/find/xargs binaries
exports.handler = async(event, context) => {
const execOpts = { stdio: 'inherit', maxBuffer: 16 * 1024 * 1024 }
let filename = 'nodejs12.x.tgz'
let cmd = 'tar -cpzf /tmp/' + filename +
' --numeric-owner --ignore-failed-read /var/runtime /var/lang /var/rapid'
execSync(cmd, execOpts)
console.log('Zipping done! Uploading...')
let data = await s3.upload({
Bucket: 'lambci',
Key: 'fs/' + filename,
Body: fs.createReadStream('/tmp/' + filename),
ACL: 'public-read',
}).promise()
console.log('Uploading done!')
console.log(process.execPath)
console.log(process.execArgv)
console.log(process.argv)
console.log(process.cwd())
console.log(__filename)
console.log(process.env)
execSync('echo /proc/1/environ; xargs -n 1 -0 < /proc/1/environ', execOpts)
execSync("bash -O extglob -c 'for cmd in /proc/+([0-9])/cmdline; do echo $cmd; xargs -n 1 -0 < $cmd; done'", execOpts)
console.log(context)
return data
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.