Skip to content

Commit 48d01c0

Browse files
Merge pull request #465 from lightpanda-io/inspector-cache-debug
don't generate debug js file on release
2 parents 7ce6998 + aca01d8 commit 48d01c0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cdp/runtime.zig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// You should have received a copy of the GNU Affero General Public License
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

19+
const builtin = @import("builtin");
1920
const std = @import("std");
2021
const cdp = @import("cdp.zig");
2122

@@ -37,7 +38,7 @@ pub fn processMessage(cmd: anytype) !void {
3738

3839
fn sendInspector(cmd: anytype, action: anytype) !void {
3940
// save script in file at debug mode
40-
if (std.log.defaultLogEnabled(.debug)) {
41+
if (builtin.mode == .Debug) {
4142
try logInspector(cmd, action);
4243
}
4344

@@ -108,7 +109,7 @@ fn logInspector(cmd: anytype, action: anytype) !void {
108109
const id = cmd.input.id orelse return error.RequiredId;
109110
const name = try std.fmt.allocPrint(cmd.arena, "id_{d}.js", .{id});
110111

111-
var dir = try std.fs.cwd().makeOpenPath("zig-cache/tmp", .{});
112+
var dir = try std.fs.cwd().makeOpenPath(".zig-cache/tmp", .{});
112113
defer dir.close();
113114

114115
const f = try dir.createFile(name, .{});

0 commit comments

Comments
 (0)