@@ -68,10 +68,12 @@ pub fn main() !void {
68
68
const cwd = std .fs .cwd ();
69
69
70
70
var input_mod_path_buffer : [std .fs .MAX_PATH_BYTES ]u8 = undefined ;
71
- const input_mod_path = try cwd .realpath ("I:/Programming/Cortex-Command-Mod-Converter-Engine/tests/mod/in" , & input_mod_path_buffer );
71
+ // const input_mod_path = try cwd.realpath("I:/Programming/Cortex-Command-Mod-Converter-Engine/tests/mod/in", &input_mod_path_buffer);
72
+ const input_mod_path = try cwd .realpath ("I:/Programming/Cortex-Command-Community-Project-Data/LegacyModConverter-v1.0-pre5.2/Input" , & input_mod_path_buffer );
72
73
73
74
var output_mod_path_buffer : [std .fs .MAX_PATH_BYTES ]u8 = undefined ;
74
- const output_mod_path = try cwd .realpath ("I:/Programming/Cortex-Command-Mod-Converter-Engine/tests/mod/out" , & output_mod_path_buffer );
75
+ // const output_mod_path = try cwd.realpath("I:/Programming/Cortex-Command-Mod-Converter-Engine/tests/mod/out", &output_mod_path_buffer);
76
+ const output_mod_path = try cwd .realpath ("I:/Programming/Cortex-Command-Community-Project-Data/Mods" , & output_mod_path_buffer );
75
77
76
78
var diagnostics : converter.Diagnostics = .{};
77
79
converter .convert (
@@ -86,7 +88,7 @@ pub fn main() !void {
86
88
const line = diagnostics .line orelse -1 ;
87
89
const column = diagnostics .column orelse -1 ;
88
90
89
- std .debug .print ("Error: Unexpected token \n Token: '{s}'\n File path: {s}\n Line: {} \n Column: {} (roughly) \n " , .{
91
+ std .debug .print ("Error: Unexpected '{s}' at {s}:{}:{} \n " , .{
90
92
token ,
91
93
file_path ,
92
94
line ,
@@ -98,7 +100,7 @@ pub fn main() !void {
98
100
const line = diagnostics .line orelse -1 ;
99
101
const column = diagnostics .column orelse -1 ;
100
102
101
- std .debug .print ("Error: Too many tabs\n File path: {s}\n Line: {} (roughly) \n Column: {} (roughly) \n " , .{
103
+ std .debug .print ("Error: Too many tabs at {s}:{}:{} \n " , .{
102
104
file_path ,
103
105
line ,
104
106
column ,
@@ -116,6 +118,23 @@ pub fn main() !void {
116
118
const result = try std .ChildProcess .exec (.{ .argv = & argv , .allocator = gpa });
117
119
_ = result ;
118
120
}
121
+ if (zgui .button ("Zip" , .{ .w = 200.0 })) {
122
+ var arena = std .heap .ArenaAllocator .init (std .heap .page_allocator );
123
+ defer arena .deinit ();
124
+ var allocator = arena .allocator ();
125
+
126
+ // TODO: Why am I using cwd.realpath()?
127
+
128
+ const cwd = std .fs .cwd ();
129
+
130
+ var input_mod_path_buffer : [std .fs .MAX_PATH_BYTES ]u8 = undefined ;
131
+ const input_mod_path = try cwd .realpath ("I:/Programming/Cortex-Command-Community-Project-Data/LegacyModConverter-v1.0-pre5.2/Input" , & input_mod_path_buffer );
132
+
133
+ var output_mod_path_buffer : [std .fs .MAX_PATH_BYTES ]u8 = undefined ;
134
+ const output_mod_path = try cwd .realpath ("I:/Programming/Cortex-Command-Community-Project-Data/Mods" , & output_mod_path_buffer );
135
+
136
+ try converter .zip_mods (input_mod_path , output_mod_path , allocator );
137
+ }
119
138
}
120
139
zgui .end ();
121
140
0 commit comments