File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// llama-ui-embed: generate ui.cpp / ui.h that embed UI assets as C arrays.
22//
33// Usage:
4- // llama-ui-embed <out_cpp> <out_h> <asset_dir>
4+ // llama-ui-embed <out_cpp> <out_h> [ <asset_dir>]
55//
66// Recursively embeds every regular file under <asset_dir>.
77// Asset names are relative paths from <asset_dir> (e.g. "_app/immutable/bundle.HASH.js").
@@ -147,9 +147,9 @@ int main(int argc, char ** argv) {
147147
148148 const std::string out_cpp = argv[1 ];
149149 const std::string out_h = argv[2 ];
150- const std::string asset_dir = argv[3 ];
150+ const std::string asset_dir = (argc >= 4 ) ? argv[3 ] : std::string () ;
151151
152- const bool use_gzip = std::filesystem::exists (asset_dir + " /_gzip" );
152+ const bool use_gzip = !asset_dir. empty () && std::filesystem::exists (asset_dir + " /_gzip" );
153153 const std::string in_dir = use_gzip ? (asset_dir + " /_gzip" ) : asset_dir;
154154
155155 std::vector<asset_entry> assets;
You can’t perform that action at this time.
0 commit comments