diff gui_ze/gui_ze.bzl @ 15:2b9e75756825

[GuiZe] Updated to handle bundling and created a shee l script for pushing.
author June Park <parkjune1995@gmail.com>
date Fri, 03 Oct 2025 06:50:33 -0700
parents de54585a40f1
children 7d3fa1a7a854
line wrap: on
line diff
--- a/gui_ze/gui_ze.bzl	Thu Oct 02 14:41:06 2025 -0700
+++ b/gui_ze/gui_ze.bzl	Fri Oct 03 06:50:33 2025 -0700
@@ -28,8 +28,16 @@
   for f in runfiles_files:
     if f.path == binary.path:
       continue
+
+    start = 0
+    for directory in f.path.split("/"):
+      if directory == binary.short_path.split("/")[0]:
+        break
+      print("\n\n equals: ", directory, binary.short_path.split("/")[0]);
+      start += 1
+
     # Remove the first folder (output) and last file (actaul files that needed to be copied)
-    paths = "/".join(f.path.split("/")[:-1])
+    paths = "/".join(f.path.split("/")[start:-1])
     full_path = "{}/{}".format(out_dir.path, paths)
     copy_cmd.append("mkdir -p {}".format(full_path))
     copy_cmd.append("cp {} {}".format(f.path, full_path))
@@ -89,6 +97,15 @@
 )
 
 def _bun_build_impl(ctx):
+  """
+  Run bun build on the folder
+
+  This sucks because you need to either copy node module into the root folder where main.ts file
+  exists or copy everything outwards. I chose to do it in this way.
+
+  TODO: If possible, maybe create a node_module inside of the main target path and create a symlink,
+  but I couldn't get it to work lol.
+  """
   out = ctx.actions.declare_file(ctx.label.name + ".js")
   inputs = [ctx.file.src] + ctx.files.data