Skip to content

Instantly share code, notes, and snippets.

@cdechery
Created May 16, 2018 12:11
Show Gist options
  • Save cdechery/50f4162601a4ea1bd0789d4740b5e476 to your computer and use it in GitHub Desktop.
Save cdechery/50f4162601a4ea1bd0789d4740b5e476 to your computer and use it in GitHub Desktop.
Edit text files on S3
#!/bin/sh
set -e
FILE=$(basename $1)
aws s3 cp "s3:/"$1 .
nano $FILE
read -p "Atualizar no S3? [s/n] " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Ss]$ ]]
then
echo "Enviando arquivo para o S3..."
aws s3 cp $FILE "s3:/"$1
else
echo "Abortando!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment