Skip to content

Commit

Permalink
possible fix for r-lib#54 (r-lib#103)
Browse files Browse the repository at this point in the history
Thanks again for working on this!
  • Loading branch information
aghaynes committed May 31, 2020
1 parent f23187c commit 31a8935
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions setup-tinytex/lib/setup-tinytex.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@ function installTinyTexWindows() {
throw `Failed to download TinyTex: ${error}`;
}
yield io.mv(downloadPath, path.join(tempDirectory, fileName));

const fs = require("fs");
console.log(path.join(tempDirectory, fileName));
var text = fs.readFileSync(path.join(tempDirectory, fileName), "utf8");
var textWithoutLastLine = text
.split("\n")
.slice(0, -2)
.join("\n");
fs.writeFile(path.join(tempDirectory, fileName), textWithoutLastLine, function (err, result) {
if (err)
console.log("error", err);
});

try {
exec.exec(path.join(tempDirectory, fileName));
}
Expand Down
17 changes: 17 additions & 0 deletions setup-tinytex/src/setup-tinytex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,23 @@ async function installTinyTexWindows() {

await io.mv(downloadPath, path.join(tempDirectory, fileName));


const fs = require("fs");
console.log(path.join(tempDirectory, fileName));
var text = fs.readFileSync(path.join(tempDirectory, fileName), "utf8");
var textWithoutLastLine = text
.split("\n")
.slice(0, -2)
.join("\n");
fs.writeFile(
path.join(tempDirectory, fileName),
textWithoutLastLine,
function(err, result) {
if (err) console.log("error", err);
}
);


try {
exec.exec(path.join(tempDirectory, fileName));
} catch (error) {
Expand Down

0 comments on commit 31a8935

Please sign in to comment.