Skip to content

Commit

Permalink
Revert "Use writefile()"
Browse files Browse the repository at this point in the history
This reverts commit 2992739.
  • Loading branch information
Shougo committed Nov 5, 2023
1 parent 5b77ca4 commit cbfdcab
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions denops/dpp/dpp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
Denops,
dirname,
extname,
fn,
is,
join,
vars,
Expand Down Expand Up @@ -356,9 +355,7 @@ export class Dpp {
}

if (plugin.hook_add) {
stateLines = stateLines.concat(
plugin.hook_add.split("\n"),
);
stateLines.push(plugin.hook_add);
}

// Merge ftplugins
Expand All @@ -377,8 +374,7 @@ export class Dpp {

// Write state file
const stateFile = `${basePath}/${name}/state.vim`;
// NOTE: Deno.writeTextFile does not work in Windows.
await fn.writefile(denops, stateLines, stateFile, "b");
await Deno.writeTextFile(stateFile, stateLines.join("\n"));

const cacheFile = `${basePath}/${name}/cache.vim`;
const cacheLines = [
Expand All @@ -389,8 +385,7 @@ export class Dpp {
checkFiles,
]),
];
// NOTE: Deno.writeTextFile does not work in Windows.
await fn.writefile(denops, cacheLines, cacheFile, "b");
await Deno.writeTextFile(cacheFile, cacheLines.join("\n"));

//console.log(stateLines);
//console.log(cacheLines);
Expand All @@ -411,8 +406,7 @@ export class Dpp {
await Deno.mkdir(parent, { recursive: true });
}

// NOTE: Deno.writeTextFile does not work in Windows.
await fn.writefile(denops, generatedFtplugins[path], path, "b");
await Deno.writeTextFile(path, generatedFtplugins[path].join("\n"));
}
}

Expand Down

0 comments on commit cbfdcab

Please sign in to comment.