summaryrefslogtreecommitdiffstats
path: root/src/jsbundle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jsbundle.c')
-rw-r--r--src/jsbundle.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/jsbundle.c b/src/jsbundle.c
new file mode 100644
index 0000000..ad98250
--- /dev/null
+++ b/src/jsbundle.c
@@ -0,0 +1,26 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <dirent.h>
+#include <string.h>
+
+int main(int argc, char* argv[]) {
+ char bundle_filename[64] = "../dist/js/bundle.js";
+ DIR *dir;
+ struct dirent *ent;
+ if ((dir = opendir ("../layout/js/")) != NULL) {
+ /* print all the files and directories within directory */
+ while ((ent = readdir (dir)) != NULL) {
+ if(strcmp(ent->d_name, ".") != 0 && strcmp(ent->d_name, "..") != 0) {
+ char *dot = strrchr(ent->d_name, '.');
+ if(dot && !strcmp(dot, ".js")) {
+ printf ("%s\n", ent->d_name);
+ }
+ }
+ }
+ closedir (dir);
+ } else {
+ /* could not open directory */
+ return 1;
+ }
+ return 0;
+}