Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: merge incomplete in non windows #14

Merged
merged 1 commit into from
Dec 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion denops/dpp/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ export {
} from "https://deno.land/std@0.209.0/async/mod.ts";
export { TimeoutError } from "https://deno.land/x/msgpack_rpc@v4.0.1/response_waiter.ts";
export { Lock } from "https://deno.land/x/async@v2.0.2/mod.ts";
export { copy } from "https://deno.land/std@0.209.0/fs/mod.ts";
15 changes: 0 additions & 15 deletions denops/dpp/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
assertEquals,
assertInstanceOf,
copy,
Denops,
is,
join,
Expand Down Expand Up @@ -79,20 +78,6 @@ export async function safeStat(path: string): Promise<Deno.FileInfo | null> {
}

export async function linkPath(hasWindows: boolean, src: string, dest: string) {
if (!hasWindows) {
try {
// NOTE: For non Windows, copy() is faster...
await copy(src, dest, { overwrite: false });
} catch (e) {
// NOTE: In Linux (and probably MacOS as well) systems, merging causes
// permission errors on overwriting a file (like .gitignore) when a
// source directory is read-only, because copy in deno_std preserve the
// permissions of the original file for the copied one.
assertInstanceOf(e, Deno.errors.AlreadyExists);
}
return;
}

if (await isDirectory(src)) {
if (!await safeStat(dest)) {
// Not exists directory
Expand Down