Misc: Move module template into seperate directory
parent
502e99841f
commit
d027f99e2d
|
@ -5,6 +5,7 @@
|
|||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "examplemodule",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"@angular/animations": "~9.1.11",
|
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
|
@ -39,15 +39,15 @@ sanitize_info() {
|
|||
MODULE_NAME=${MODULE_NAME// /}
|
||||
}
|
||||
|
||||
create_template() {
|
||||
if [[ ! -d "examplemodule" ]]; then
|
||||
create_from_template() {
|
||||
if [[ ! -d "Misc/module-template" ]]; then
|
||||
echo "[!!] The template module seems to be missing. Please re-clone this repository and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[*] Creating New Module ($MODULE_NAME)."
|
||||
|
||||
cp -r examplemodule $MODULE_NAME
|
||||
cp -r Misc/module-template $MODULE_NAME
|
||||
|
||||
grep -rl examplemodule $MODULE_NAME/ | xargs sed -i "s/examplemodule/$MODULE_NAME/g"
|
||||
grep -rl example-module $MODULE_NAME/ | xargs sed -i "s/example-module/$MODULE_NAME/g"
|
||||
|
@ -101,7 +101,7 @@ finish() {
|
|||
main() {
|
||||
print_banner
|
||||
get_info
|
||||
create_template
|
||||
create_from_template
|
||||
ask_prepare_node
|
||||
|
||||
finish
|
||||
|
|
Loading…
Reference in New Issue