I would like a bash shell script written which will check what files have changed with git. My project has two theme folders each folder has it's own scss and js assets. The bash script will check if files have changed in theme folder one or theme folder two or maybe both themes have changes to scss or js
The script will use git diff
Check which theme folders have changed files with extension .scss or .js
Then change directory to that theme folder and run yarn build
Then run zip -r [login to view URL] dist/
This will create a zip of the compiled assets for the theme
A few things to note are scss and js might be changed in both theme folders.
Only run yarn build once in each theme folder. So if 3 files are changed in a theme folder the yarn build will only run one time and zip the files
Here's some sample code to maybe help get you started
# folder path one includes "themes/one'
# folder path two includes "themes/two"
git diff --name-only | \
while read filechanged # folder/folder/themes/one/[login to view URL]
5 freelancers are bidding on average $109 for this job
Hello I am having lots of experience in bash scripting and i can do this task as well but i am having few questions to discuss so can you come on discussion Thanks Nirmal