From 057f7ac151496b3b532fbe6e0824ce287d84054e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Mon, 19 Sep 2022 07:43:09 +0800 Subject: Move everything up, no more web dir --- .gitmodules | 3 +++ Makefile.am | 4 ++++ configure.ac | 8 ++++++++ frontend | 1 + main.c | 32 ++++++++++++++++++++++++++++++++ web/Makefile.am | 4 ---- web/configure.ac | 8 -------- web/frontend | 1 - web/main.c | 32 -------------------------------- 9 files changed, 48 insertions(+), 45 deletions(-) create mode 100644 Makefile.am create mode 100644 configure.ac create mode 160000 frontend create mode 100644 main.c delete mode 100644 web/Makefile.am delete mode 100644 web/configure.ac delete mode 160000 web/frontend delete mode 100644 web/main.c diff --git a/.gitmodules b/.gitmodules index 511fb07..847c4d1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "web/frontend"] path = web/frontend url = git://darapsa.org/shopify-frontend-template-html +[submodule "frontend"] + path = frontend + url = git://darapsa.org/shopify-frontend-template-html diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..310bd37 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,4 @@ +bin_PROGRAMS = shopifyappd +shopifyappd_SOURCES = main.c +shopifyappd_CPPFLAGS = $(DEPS_CFLAGS) +shopifyappd_LDFLAGS = $(DEPS_LIBS) -ltoml -lshopify diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..e7a4060 --- /dev/null +++ b/configure.ac @@ -0,0 +1,8 @@ +AC_INIT([shopify-app-template-c], [0.0], [prabowo@darapsa.org]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_PROG_CC +PKG_CHECK_MODULES([DEPS], [libmicrohttpd libgcrypt gnutls libpcre2-8 libcurl json-c]) +AC_FUNC_MALLOC +AC_TYPE_SIZE_T +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/frontend b/frontend new file mode 160000 index 0000000..023d646 --- /dev/null +++ b/frontend @@ -0,0 +1 @@ +Subproject commit 023d6464cbf37774ea93dd950bda9350179dfab0 diff --git a/main.c b/main.c new file mode 100644 index 0000000..240d9bd --- /dev/null +++ b/main.c @@ -0,0 +1,32 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + const size_t app_dir_len = strlen(APP_DIR); + static const char *scope_rel = "/shopify.app.toml"; + char scope[app_dir_len + strlen(scope_rel) + 1]; + sprintf(scope, "%s%s", APP_DIR, scope_rel); + static const char *index_rel = "/frontend/index.html"; + char index[app_dir_len + strlen(index_rel) + 1]; + sprintf(index, "%s%s", APP_DIR, index_rel); + shopify_app(API_KEY, API_SECRET_KEY, APP_URL, "/auth", APP_ID, scope, + index, (struct shopify_api[]){ + { + "/products", + "GET", + shopify_graphql, + "{"\ + " productCreate() {"\ + " product {"\ + " id"\ + " }"\ + " }"\ + "}" + }, + {} + } + ); + return 0; +} diff --git a/web/Makefile.am b/web/Makefile.am deleted file mode 100644 index 310bd37..0000000 --- a/web/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -bin_PROGRAMS = shopifyappd -shopifyappd_SOURCES = main.c -shopifyappd_CPPFLAGS = $(DEPS_CFLAGS) -shopifyappd_LDFLAGS = $(DEPS_LIBS) -ltoml -lshopify diff --git a/web/configure.ac b/web/configure.ac deleted file mode 100644 index 7ef439c..0000000 --- a/web/configure.ac +++ /dev/null @@ -1,8 +0,0 @@ -AC_INIT([shopify-app-template-c], [0.0], [erik@darapsa.co.id]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -AC_PROG_CC -PKG_CHECK_MODULES([DEPS], [libmicrohttpd libgcrypt gnutls libpcre2-8 libcurl json-c]) -AC_FUNC_MALLOC -AC_TYPE_SIZE_T -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/web/frontend b/web/frontend deleted file mode 160000 index 023d646..0000000 --- a/web/frontend +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 023d6464cbf37774ea93dd950bda9350179dfab0 diff --git a/web/main.c b/web/main.c deleted file mode 100644 index e14ebe6..0000000 --- a/web/main.c +++ /dev/null @@ -1,32 +0,0 @@ -#include -#include -#include - -int main(int argc, char *argv[]) -{ - const size_t app_dir_len = strlen(APP_DIR); - static const char *scope_rel = "/shopify.app.toml"; - char scope[app_dir_len + strlen(scope_rel) + 1]; - sprintf(scope, "%s%s", APP_DIR, scope_rel); - static const char *index_rel = "/web/frontend/index.html"; - char index[app_dir_len + strlen(index_rel) + 1]; - sprintf(index, "%s%s", APP_DIR, index_rel); - shopify_app(API_KEY, API_SECRET_KEY, APP_URL, "/auth", APP_ID, scope, - index, (struct shopify_api[]){ - { - "/products", - "GET", - shopify_graphql, - "{"\ - " productCreate() {"\ - " product {"\ - " id"\ - " }"\ - " }"\ - "}" - }, - {} - } - ); - return 0; -} -- cgit v1.2.3