Skip to content

Commit

Permalink
Revert "fix create with github URL on windows (#10231)" (#10236)
Browse files Browse the repository at this point in the history
This reverts commit 1820d08.
  • Loading branch information
Jarred-Sumner authored Apr 13, 2024
1 parent 4627af5 commit 65d8288
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
12 changes: 3 additions & 9 deletions src/cli/create_command.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1611,9 +1611,7 @@ 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];
if (!bun.sys.existsAt(bun.invalid_fd, outdir_path_)) {
break :outer;
}
std.fs.accessAbsoluteZ(outdir_path_, .{}) catch break :outer;
example_tag = Example.Tag.local_folder;
break :brk outdir_path;
}
Expand All @@ -1624,9 +1622,7 @@ 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];
if (!bun.sys.existsAt(bun.invalid_fd, outdir_path_)) {
break :outer;
}
std.fs.accessAbsoluteZ(outdir_path_, .{}) catch break :outer;
example_tag = Example.Tag.local_folder;
break :brk outdir_path;
}
Expand All @@ -1637,9 +1633,7 @@ 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];
if (!bun.sys.existsAt(bun.invalid_fd, outdir_path_)) {
break :outer;
}
std.fs.accessAbsoluteZ(outdir_path_, .{}) catch break :outer;
example_tag = Example.Tag.local_folder;
break :brk outdir_path;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sys.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2120,7 +2120,7 @@ pub fn exists(path: []const u8) bool {

pub fn existsAt(fd: bun.FileDescriptor, subpath: []const u8) bool {
if (comptime Environment.isPosix) {
return system.faccessat(fd.cast(), &(std.os.toPosixPath(subpath) catch return false), 0, 0) == 0;
return system.faccessat(bun.toFD(fd), &(std.os.toPosixPath(subpath) catch return false), 0, 0) == 0;
}

if (comptime Environment.isWindows) {
Expand Down

0 comments on commit 65d8288

Please sign in to comment.