fix: avoid spurious "switched to project" messages
This commit is contained in:
parent
870ee1df1f
commit
e752e8a405
1 changed files with 2 additions and 0 deletions
|
@ -53,6 +53,8 @@ pub fn shutdown() void {
|
||||||
pub fn open(rel_project_directory: []const u8) (ProjectManagerError || FileSystemError || std.fs.File.OpenError || SetCwdError)!void {
|
pub fn open(rel_project_directory: []const u8) (ProjectManagerError || FileSystemError || std.fs.File.OpenError || SetCwdError)!void {
|
||||||
var path_buf: [std.fs.max_path_bytes]u8 = undefined;
|
var path_buf: [std.fs.max_path_bytes]u8 = undefined;
|
||||||
const project_directory = std.fs.cwd().realpath(rel_project_directory, &path_buf) catch "(none)";
|
const project_directory = std.fs.cwd().realpath(rel_project_directory, &path_buf) catch "(none)";
|
||||||
|
const current_project = tp.env.get().str("project");
|
||||||
|
if (std.mem.eql(u8, current_project, project_directory)) return;
|
||||||
var dir = try std.fs.openDirAbsolute(project_directory, .{});
|
var dir = try std.fs.openDirAbsolute(project_directory, .{});
|
||||||
try dir.setAsCwd();
|
try dir.setAsCwd();
|
||||||
dir.close();
|
dir.close();
|
||||||
|
|
Loading…
Add table
Reference in a new issue