mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
fix create with github URL on windows (#10231)
* correctly ignore error on windows to match posix behavior * replace zig accessat with bun.sys.existsAt * fix posix build
This commit is contained in:
@@ -1611,7 +1611,9 @@ pub const CreateCommand = struct {
|
||||
const outdir_path = filesystem.absBuf(&parts, &home_dir_buf);
|
||||
home_dir_buf[outdir_path.len] = 0;
|
||||
const outdir_path_ = home_dir_buf[0..outdir_path.len :0];
|
||||
std.fs.accessAbsoluteZ(outdir_path_, .{}) catch break :outer;
|
||||
if (!bun.sys.existsAt(bun.invalid_fd, outdir_path_)) {
|
||||
break :outer;
|
||||
}
|
||||
example_tag = Example.Tag.local_folder;
|
||||
break :brk outdir_path;
|
||||
}
|
||||
@@ -1622,7 +1624,9 @@ pub const CreateCommand = struct {
|
||||
const outdir_path = filesystem.absBuf(&parts, &home_dir_buf);
|
||||
home_dir_buf[outdir_path.len] = 0;
|
||||
const outdir_path_ = home_dir_buf[0..outdir_path.len :0];
|
||||
std.fs.accessAbsoluteZ(outdir_path_, .{}) catch break :outer;
|
||||
if (!bun.sys.existsAt(bun.invalid_fd, outdir_path_)) {
|
||||
break :outer;
|
||||
}
|
||||
example_tag = Example.Tag.local_folder;
|
||||
break :brk outdir_path;
|
||||
}
|
||||
@@ -1633,7 +1637,9 @@ pub const CreateCommand = struct {
|
||||
const outdir_path = filesystem.absBuf(&parts, &home_dir_buf);
|
||||
home_dir_buf[outdir_path.len] = 0;
|
||||
const outdir_path_ = home_dir_buf[0..outdir_path.len :0];
|
||||
std.fs.accessAbsoluteZ(outdir_path_, .{}) catch break :outer;
|
||||
if (!bun.sys.existsAt(bun.invalid_fd, outdir_path_)) {
|
||||
break :outer;
|
||||
}
|
||||
example_tag = Example.Tag.local_folder;
|
||||
break :brk outdir_path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user