aboutsummaryrefslogtreecommitdiff
path: root/templates/class.sh
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2025-04-05 16:20:05 +0530
committerAkshay Nair <phenax5@gmail.com>2025-04-05 16:20:05 +0530
commit09cdcd15b31469c839831cad534fec9896999b60 (patch)
tree4aea664837807d06b2056c83191143fb9a8f3d54 /templates/class.sh
parentc4413f3cca0a0750af9881276162b70f3489b499 (diff)
downloadnull-browser-09cdcd15b31469c839831cad534fec9896999b60.tar.gz
null-browser-09cdcd15b31469c839831cad534fec9896999b60.zip
Refactor event queue out of router
Diffstat (limited to '')
-rwxr-xr-xtemplates/class.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/templates/class.sh b/templates/class.sh
index ad60acf..e49b99d 100755
--- a/templates/class.sh
+++ b/templates/class.sh
@@ -7,7 +7,9 @@ path="$2"
[ -z "$class_name" ] && exit 1
-if ! [ -z "$path" ]; then
+if [ -z "$path" ]; then
+ path="$path/"
+else
mkdir -p "./src/$path"
fi
@@ -15,17 +17,15 @@ fi
echo "#pragma once
class $class_name {
- Q_OBJECT
-
public:
$class_name();
};
-" > "./src/$path/$class_name.hpp"
+" > "./src/$path$class_name.hpp"
# Implementation
echo "
-#include \"$path/$class_name.hpp\"
+#include \"$path$class_name.hpp\"
$class_name::$class_name() {}
-" > "./src/$path/$class_name.cpp"
+" > "./src/$path$class_name.cpp"