Write a bash script to check output of git diff if changed files are in specific folder run yarn then zip

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]


echo $filechanged


echo $extension


Habilidades: Bash Scripting, Shell Script

Veja mais: git diff head, git status shows files as changed even though contents are the same, git patch, git diff file, git export changed files between commits, git status shows modified files, git copy modified files, git diff not showing all changes, bash script check web page, write mail bash script, bash script check website working, bash script check server status, bash script check ftp connection, bash script check proxy, bash script check website, bash script check phone numbers, ffmpeg bash script output, script bash parse file output, check website availability bash script, insert bash script output mysql

Acerca do Empregador:
( 21 comentários ) Mount Sinai, United States

ID do Projeto: #17869923

Concedido a:


Bash guru at your service. Its a simple bash script. I can do it in an hour. Thank you..............

$30 USD em 1 dia
(147 Comentários)

5 freelancers estão ofertando em média $109 para esse trabalho


Hi, I have not tried git within a shell script. But being a shell script, this is something i can do it easily based on your requirement. Only thing which confuse is the scss and js part. By the way, i will read thi Mais

$88 USD in 2 dias
(11 Comentários)

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

$155 USD in 3 dias
(5 Comentários)
$200 USD in 3 dias
(2 Comentários)

Hi I am an Devops engineer experienced in shell scripting for linux system monitoring, troubleshooting, automation etc. I can do this bash script to find changed git repositories and then execute yarn build command on Mais

$72 USD in 6 dias
(1 Comentário)