Running a deployment script that removes the .html part of a file before uploading it to an S3 bucket. Currently using the following:
cd out/
for file in `ls -l *.html`; do
newname=`echo $file|sed 's/\.html$//g'`
mv $file $newname
aws2 s3 cp ./$newname s3://$S3_BUCKET_NAME/
done
This works perfectly for files in the out/
folder, but it completely ignores, for example, out/folder/file
.
Ideally I would be able to perform the same action (of removing the .html part of the filename) on sub-folders and pass that to my upload command.