Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaotian committed Nov 15, 2024
1 parent e37c449 commit 7106d17
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions scripts/replace-files-for-deno.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ async function start() {

await Promise.all(
files.map(async (item) => {
const content = await fs.readFile(item, 'utf8');
return fs.writeFile(item, content.replace(/'xior\/utils'/g, "'./utils'"));
let content = await fs.readFile(item, 'utf8');
content = content.replace(/'xior\/utils'/g, "'./utils'");
content = content.replace(/from '\.(.*)';/g, (a, b, c) => {
return "from '." + b + ".ts';";
});
return fs.writeFile(item, content);
})
);

await Promise.all(
pluginFiles.map(async (item) => {
const content = await fs.readFile(item, 'utf8');
return fs.writeFile(item, content.replace(/'xior\/utils'/g, "'../utils'"));
let content = await fs.readFile(item, 'utf8');
content = content.replace(/'xior\/utils'/g, "'../utils'");
content = content.replace(/from '\.(.*)';/g, (a, b, c) => {
return "from '." + b + ".ts';";
});
return fs.writeFile(item, content);
})
);
}
Expand Down

0 comments on commit 7106d17

Please sign in to comment.