files: "/tmp/fixnpm.sh": mode: "000755" owner: root group: root content: | #!/bin/bash FILE="/etc/hook-modified" if [ ! -f "$FILE" ] then sed -i 's/function error_exit/export HOME=\/root\n\nfunction error_exit/' /opt/elasticbeanstalk/hooks/appdeploy/pre/50npm.sh touch $FILE exit 0 else exit 0 fi commands: fixnpm: command: "sh /tmp/fixnpm.sh"