Skip to content

Commit

Permalink
Corrigir construção de recursos
Browse files Browse the repository at this point in the history
Closes #200
  • Loading branch information
dgadelha committed Apr 9, 2024
1 parent bd84b80 commit 1506799
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/resources/src/atualizar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export async function configurarRecursos() {
await fs.unlink(psZip);

console.log("Gerando índice da aba Ajuda...");
// @ts-expect-error
await import(join(baseDir, "ajuda", "scripts", "topicos.js"));
await import(path.join(baseDir, "ajuda", "scripts", "topicos.js"));
// require(join(baseDir, "ajuda", "scripts", "topicos"));

console.log("Ajustando arquivos HTML...");
Expand Down
6 changes: 3 additions & 3 deletions packages/resources/src/helpers/patch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ async function patchHtmlFile(data: Buffer) {
}

export async function patchHtmlFiles() {
const topicosDir = join(baseDir, "ajuda", "topicos");
const topicosDir = path.join(baseDir, "ajuda", "topicos");

for await (const file of readdirp(topicosDir, {
type: "files",
fileFilter: "*.html",
})) {
console.log(`-> Ajustando ${file.path}`);
const fileName = join(topicosDir, file.path);
const fileName = path.join(topicosDir, file.path);
const data = await fs.readFile(fileName);

await fs.writeFile(fileName, await patchHtmlFile(data));
Expand All @@ -80,7 +80,7 @@ export async function patchPortugolFiles() {
fileFilter: "*.por",
})) {
console.log(`-> Ajustando ${file.path}`);
const fileName = join(baseDir, file.path);
const fileName = path.join(baseDir, file.path);
let data = iconv.decode(await fs.readFile(fileName), "ISO-8859-1");

const portugolSignaturePos = data.indexOf("/* $$$ Portugol Studio $$$ ");
Expand Down

0 comments on commit 1506799

Please sign in to comment.