From aeef95ae52a73544681b45e387f7dd580e88e011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20L=2E=20=C5=A0ijanec?= Date: Tue, 28 Apr 2020 22:53:07 +0200 Subject: delam. --- src/jsbundle.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/jsbundle.c (limited to 'src/jsbundle.c') 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 +#include +#include +#include + +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; +} -- cgit v1.2.3