mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 15:13:28 +00:00
Merge pull request #465 from lightpanda-io/inspector-cache-debug
Some checks are pending
e2e-test / zig build release (push) Waiting to run
e2e-test / puppeteer-perf (push) Blocked by required conditions
e2e-test / demo-scripts (push) Blocked by required conditions
wpt / web platform tests (push) Waiting to run
wpt / perf-fmt (push) Blocked by required conditions
zig-test / zig build dev (push) Waiting to run
zig-test / zig test (push) Waiting to run
zig-test / perf-fmt (push) Blocked by required conditions
Some checks are pending
e2e-test / zig build release (push) Waiting to run
e2e-test / puppeteer-perf (push) Blocked by required conditions
e2e-test / demo-scripts (push) Blocked by required conditions
wpt / web platform tests (push) Waiting to run
wpt / perf-fmt (push) Blocked by required conditions
zig-test / zig build dev (push) Waiting to run
zig-test / zig test (push) Waiting to run
zig-test / perf-fmt (push) Blocked by required conditions
don't generate debug js file on release
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
const builtin = @import("builtin");
|
||||
const std = @import("std");
|
||||
const cdp = @import("cdp.zig");
|
||||
|
||||
@@ -37,7 +38,7 @@ pub fn processMessage(cmd: anytype) !void {
|
||||
|
||||
fn sendInspector(cmd: anytype, action: anytype) !void {
|
||||
// save script in file at debug mode
|
||||
if (std.log.defaultLogEnabled(.debug)) {
|
||||
if (builtin.mode == .Debug) {
|
||||
try logInspector(cmd, action);
|
||||
}
|
||||
|
||||
@@ -108,7 +109,7 @@ fn logInspector(cmd: anytype, action: anytype) !void {
|
||||
const id = cmd.input.id orelse return error.RequiredId;
|
||||
const name = try std.fmt.allocPrint(cmd.arena, "id_{d}.js", .{id});
|
||||
|
||||
var dir = try std.fs.cwd().makeOpenPath("zig-cache/tmp", .{});
|
||||
var dir = try std.fs.cwd().makeOpenPath(".zig-cache/tmp", .{});
|
||||
defer dir.close();
|
||||
|
||||
const f = try dir.createFile(name, .{});
|
||||
|
||||
Reference in New Issue
Block a user