@@ -8,36 +8,36 @@ import (
8
8
"os"
9
9
"path/filepath"
10
10
11
- "github.com/urfave/cli"
11
+ "github.com/urfave/cli/v2 "
12
12
)
13
13
14
14
func main () {
15
- app := cli .NewApp ()
16
- app .Name = "build-lambda-zip"
17
- app .Usage = "Put an executable and supplemental files into a zip file that works with AWS Lambda."
18
- app .Flags = []cli.Flag {
19
- & cli.StringFlag {
20
- Name : "output, o" ,
21
- Value : "" ,
22
- Usage : "output file path for the zip. Defaults to the first input file name." ,
15
+ app := & cli.App {
16
+ Name : "build-lambda-zip" ,
17
+ Usage : "Put an executable and supplemental files into a zip file that works with AWS Lambda." ,
18
+ Flags : []cli.Flag {
19
+ & cli.StringFlag {
20
+ Name : "output, o" ,
21
+ Value : "" ,
22
+ Usage : "output file path for the zip. Defaults to the first input file name." ,
23
+ },
23
24
},
24
- }
25
-
26
- app .Action = func (c * cli.Context ) error {
27
- if ! c .Args ().Present () {
28
- return errors .New ("no input provided" )
29
- }
25
+ Action : func (c * cli.Context ) error {
26
+ if ! c .Args ().Present () {
27
+ return errors .New ("no input provided" )
28
+ }
30
29
31
- inputExe := c .Args ().First ()
32
- outputZip := c .String ("output" )
33
- if outputZip == "" {
34
- outputZip = fmt .Sprintf ("%s.zip" , filepath .Base (inputExe ))
35
- }
30
+ inputExe := c .Args ().First ()
31
+ outputZip := c .String ("output" )
32
+ if outputZip == "" {
33
+ outputZip = fmt .Sprintf ("%s.zip" , filepath .Base (inputExe ))
34
+ }
36
35
37
- if err := compressExeAndArgs (outputZip , inputExe , c .Args ().Tail ()); err != nil {
38
- return fmt .Errorf ("failed to compress file: %v" , err )
39
- }
40
- return nil
36
+ if err := compressExeAndArgs (outputZip , inputExe , c .Args ().Tail ()); err != nil {
37
+ return fmt .Errorf ("failed to compress file: %v" , err )
38
+ }
39
+ return nil
40
+ },
41
41
}
42
42
43
43
if err := app .Run (os .Args ); err != nil {
0 commit comments