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