mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Add npm tools
This commit is contained in:
8 files changed
+758
-5
No files matched your search
@@ -74,7 +74,7 @@ export class TextEditorStrReplaceTool implements Tool<TextEditorStrReplaceParams
|
||||
|
||||
try {
|
||||
const absolutePath = join(this.cwd, path);
|
||||
const content = await this.fs.readFile(absolutePath, "utf-8");
|
||||
const content = await this.fs.readFile(absolutePath, "utf8");
|
||||
|
||||
// Helper function to normalize whitespace
|
||||
const normalizeWhitespace = (str: string): string => {
|
||||
@@ -177,7 +177,7 @@ export class TextEditorStrReplaceTool implements Tool<TextEditorStrReplaceParams
|
||||
newContent = content.replace(old_str, new_str);
|
||||
}
|
||||
|
||||
await this.fs.writeFile(absolutePath, newContent, "utf-8");
|
||||
await this.fs.writeFile(absolutePath, newContent, "utf8");
|
||||
|
||||
let successMessage = `String successfully replaced in ${path}`;
|
||||
if (occurrences > 1) {
|
||||
|
||||
Reference in new issue
Block a user