lambchop 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +10 -3
- data/lib/lambchop/client.rb +14 -0
- data/lib/lambchop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea62c77a6ac1568c61714754f3f6b1f43b875d4
|
4
|
+
data.tar.gz: 7a2be55dbe9adbbe746c3cc53dbe9418cd8a1609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 464363eb0712671e815688fb67853102cdee49a4615c2c9a52607b4636463f8267b47a88316ad8e341bffb3ce49eddd66cdfcc0427c03dbd5c47f8199a33b505
|
7
|
+
data.tar.gz: 6d912182b4202f0bc7fa1720f36403eb84b7170f16e33a94d5e01e6db6dd09e1b6b33eb0df1baae728a7d1f07f3aa5b832871cec301bb0af2272686f10e131c6
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -69,7 +69,7 @@ END RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
69
69
|
REPORT RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Duration: 117.54 ms Billed Duration: 200 ms Memory Size: 128 MB Max Memory Used: 9 MB
|
70
70
|
```
|
71
71
|
|
72
|
-
|
72
|
+
## Dump function
|
73
73
|
|
74
74
|
```sh
|
75
75
|
$ lambchop-dump
|
@@ -97,14 +97,14 @@ exports.handler = function(event, context) {
|
|
97
97
|
};
|
98
98
|
```
|
99
99
|
|
100
|
-
|
100
|
+
## Upload only
|
101
101
|
|
102
102
|
```javascript
|
103
103
|
#!/usr/bin/env lambchop -d
|
104
104
|
...
|
105
105
|
```
|
106
106
|
|
107
|
-
|
107
|
+
## Follow log only
|
108
108
|
|
109
109
|
```sh
|
110
110
|
~$ lambchop-tail
|
@@ -115,6 +115,13 @@ START RequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
|
115
115
|
...
|
116
116
|
```
|
117
117
|
|
118
|
+
# node module path
|
119
|
+
```
|
120
|
+
.
|
121
|
+
├── lambda-script.js
|
122
|
+
└── node_modules/
|
123
|
+
```
|
124
|
+
|
118
125
|
## Demo
|
119
126
|
|
120
127
|
* https://asciinema.org/a/14158
|
data/lib/lambchop/client.rb
CHANGED
@@ -41,9 +41,23 @@ class Lambchop::Client
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def zip_source(src)
|
44
|
+
src_dir = File.dirname(@path)
|
45
|
+
node_modules = []
|
46
|
+
|
47
|
+
Dir.glob("#{src_dir}/node_modules/**/*") do |file|
|
48
|
+
if File.file?(file)
|
49
|
+
node_modules << file
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
44
53
|
Zip::OutputStream.write_buffer do |out|
|
45
54
|
out.put_next_entry(File.basename(@path))
|
46
55
|
out.write(src)
|
56
|
+
|
57
|
+
node_modules.each do |file|
|
58
|
+
out.put_next_entry(file.sub(%r|\A#{src_dir}/|, ''))
|
59
|
+
out.write(open(file, &:read))
|
60
|
+
end
|
47
61
|
end
|
48
62
|
end
|
49
63
|
|
data/lib/lambchop/version.rb
CHANGED