lifadev / archive_aws-lambda-go-shim

Author your AWS Lambda functions in Go, effectively.
https://github.com/eawsy/aws-lambda-go-shim
Apache License 2.0
789 stars 66 forks source link

preview.bash not working on osx #42

Closed dragonfax closed 6 years ago

dragonfax commented 6 years ago
\e[32m> Invoke AWS Lambda function\e[0m
base64: invalid option -- d
Usage:  base64 [-hvD] [-b num] [-i in_file] [-o out_file]
  -h, --help     display this message
  -D, --decode   decodes input
  -b, --break    break encoded string into num character lines
  -i, --input    input file (default: "-" for stdin)
  -o, --output   output file (default: "-" for stdout)
17245-jstillwell:aws-go-test jstillwell$ aws --version
aws-cli/1.11.118 Python/2.7.13 Darwin/16.7.0 botocore/1.5.81

Installed via brew on macos 10.12

dragonfax commented 6 years ago

Works fine if I change it to a capital D

fsenart commented 6 years ago

@dragonfax thx for reporting this issue. The script was initially developed for Linux users, also we should adapt it to make it more portable. I will keep the issue open until os specific commands are added to the script.

dragonfax commented 6 years ago

Well frankly, it worked perfectly with the exception of that one command line option. You switch that to a capital D on macos and you got yourself a cross platform script.

On Wed, Nov 15, 2017 at 1:46 AM Farzad Senart notifications@github.com wrote:

@dragonfax https://github.com/dragonfax thx for reporting this issue. The script was initially developed for Linux user, also we should adapt it to make more portable. I will keep the issue open until os specific commands are added to the script.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eawsy/aws-lambda-go-shim/issues/42#issuecomment-344539992, or mute the thread https://github.com/notifications/unsubscribe-auth/AA4_rhIEiJMJXwLc7hb3eS1cf52n5Jqiks5s2rL6gaJpZM4QeXfC .

cristim commented 6 years ago

I think the capital D option that works on Mac may not work on Linux.

As someone once said, the shell is often more portable than a simple shell script.

A better option is to replace the shell script will a script written in a proper programming language, which is often available pre-installed, for example Python.

dragonfax commented 6 years ago

https://github.com/eawsy/aws-lambda-go-shim/pull/43

dragonfax commented 6 years ago

Y'all overthink things.

fsenart commented 6 years ago

@cristim IMHO you're right and we definitely should abandon writing such scripts in bash and python is the good choice. But here @dragonfax comes with a surgical #43 and it allows us to avoid developing something not very essential to the core of the project.