This script is to use when you duplicate a module.
For example, lets say you have all the crud basic feature for user
and you would like to seed the feature product
with it.
You'll have to copy "user" into "product", search and replace every file:
- replace
"user"
by"product"
- and
"User"
by"Product"
- and
"USER"
by"PRODUCT"
- and rename files
XXX_USER.py
toXXX_PRODUCT.py
- and
UserXXX.js
toProductXXX.js
- and
createUser.tsx
tocreateProduct.tsx
- and rename the folder
userLibs
toproductLibs
etc...
You'll need to have Nodejs installed. Copy this script in a folder in your path, make it executable and you should be good to go.
curl https://gist.githubusercontent.com/debrice/83e3740eb20be24bb95f8b179d3a4503/raw -o /usr/local/bin/fromModule
chmod +x /usr/local/bin/fromModule
this script takes care of that in just 3 lines:
cp -r user product
cd product
fromModule user product