Skip to content

Instantly share code, notes, and snippets.

@yatishbalaji
yatishbalaji / multiDirGit
Last active January 14, 2021 12:29
Create Alias to run any command on multiple directories. EG: Used for maintaining multiple git repositories by single command
export workspace=($HOME"/projects/project1" $HOME"/projects/project2");
export multiDirExec() {
for dir in ${workspace[@]}; do
echo 'Running >>>> '$dir ' >>>> ' $1 ;
(cd "$dir" && eval "$1");
done;
}
# GET VERSION
yarn -v (or --version)
# GET HELP
yarn help
# CREATE PACKAGE.JSON
yarn init
yarn init -y // Use defaults