Skip to content

Instantly share code, notes, and snippets.

@zugarzeeker
Created August 6, 2016 15:59
Show Gist options
  • Select an option

  • Save zugarzeeker/8b155af665aabd35b61f4dcc62ff172a to your computer and use it in GitHub Desktop.

Select an option

Save zugarzeeker/8b155af665aabd35b61f4dcc62ff172a to your computer and use it in GitHub Desktop.
# !/bin/bash
color_lgreen="\033[01;32m"
color_lred="\033[01;31m"
color_end="\033[0m"
if [ $# -eq 0 ]
then
echo ${color_lred}[Error]${color_end} : Please input filename as params
exit
fi
filename=$(sed "s/\.js//g" <<< $1)
sed "s/\.js//g" <<< $filename > $filename
all_path=( "actions" "entities" "interactors" "reducers" )
for path in "${all_path[@]}"
do
filepath=src/redux/$path/$filename.js
touch $filepath
echo ${color_lgreen}create${color_end} $filepath
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment