Completed

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]

do

echo $filechanged

extension="${filechanged##*.}"

echo $extension

...

Skills: Bash Scripting, Shell Script

See more: 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

About the Employer:
( 21 reviews ) Mount Sinai, United States

Project ID: #17869923

Awarded to:

kaloyan13

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

$30 USD in 1 day
(147 Reviews)
6.2

5 freelancers are bidding on average $109 for this job

VarunUnix

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 More

$88 USD in 2 days
(11 Reviews)
3.4
nirmaljeetverma

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 days
(5 Reviews)
2.8
$200 USD in 3 days
(2 Reviews)
2.2
sambestsolutions

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 More

$72 USD in 6 days
(1 Review)
0.8