Set of Node CLI scripts for downloading s3 files, doing string replaces, and reuploading them. Uses the aws-sdk package.
You must have your AWS keys stored locally to use this. See aws config files for more information.
You must have node and npm.
Run yarn install
or npm install
to install the dependency (aws-sdk)
Run: node getFiles.js path/to/file/with/filenames path/to/folder/to/upload/them/to bucketName
Example: node getFiles.js files.txt ./files/ my-bucket-name
The upload folders must already exist. Your files.txt should list each file name you want to download separated by a new line.
Run: node replaceStrings.js path/to/folder/where/files/exist
Example: node replaceStrings.js /Users/you/stuff
The folder must already exist. You should edit the replaceStrings.js file with the regex of what you want to replace.
Run: node uploadFiles.js path/to/folder/where/files/exist bucketName
Example: node uploadFiles.js /Users/you/stuff my-bucket-name
The folder must already exist. This example uses Content-Type: text/html. You can change this in uploadFiles.js.