samwatch is a tool based in nodemon that helps you monitor and transport your changes from your source tree structure to the .sam-build tree structure while developing with AWS SAM.
samwatch detects changes in your source files, and if the current changed file already exists inside the .sam-build tree structure, it makes a copy of it in the corresponding .sam-build location, keeping your source and .sam-build folders in sync.
If no corresponding file is available in the .sam-build tree structure, samwatch will issue a "sam build" command.
This behavior can reduce the use of "sam build" from every time you make a change to only once whenever you need to add new files or folders to the .sam-build folder structure.
Either through cloning with git or by using npm (the recommended way):
npm install samwatch -g
Go to the root of your development and run:
samwatch
This will start samwatch.
Next, you can start working with your files, and samwatch will copy the saved changes to .aws-sam folder.
samwatch n
If you wish samwatch just to notify about the missing file and not run sam build after the error, use n or notify argument
Running samwatch, saving the modified file, sam-build folder gets updated.