Skip to content

Instantly share code, notes, and snippets.

@maxpeterson
Created January 12, 2021 08:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxpeterson/53abc94f49efc3071b1aeaa56cb131df to your computer and use it in GitHub Desktop.
Save maxpeterson/53abc94f49efc3071b1aeaa56cb131df to your computer and use it in GitHub Desktop.
Alias to convert / move next project "module" to library
function nestToLibrary {
name=$1
if [ -z "$name" ]; then
echo 'No module name provided'
return 1;
fi
nest generate library "${name}"
rm libs/${name}/src/${name}.*
git mv apps/cynomi/src/${name}/* libs/${name}/src
rm -rf "apps/cynomi/src/${name}"
ack "\.?\./${name}/" apps libs -l | xargs sed -i '' -e "s/\.\{1,2\}\/${name}\//@app\/${name}\//"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment