Skip to content

Commit

Permalink
Read package json as utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaswilli committed Oct 9, 2021
1 parent 3d824f4 commit b718c9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8562,16 +8562,16 @@ async function main() {
})
);

core.info("Successfully deleted assets!");
core.info("Done.");
}

function getVersionFromPackageJson() {
core.info("Input 'tag' not specified. Reading version from package.json");

return new Promise((res) => {
fs.readFile("./package.json", (err, data) => {
fs.readFile("./package.json", "utf-8", (err, data) => {
if (err) throw new Error(err.message);
else res(JSON.parse(data.toString()).version);
else res(JSON.parse(data).version);
});
});
}
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ async function main() {
})
);

core.info("Successfully deleted assets!");
core.info("Done.");
}

function getVersionFromPackageJson() {
core.info("Input 'tag' not specified. Reading version from package.json");

return new Promise((res) => {
fs.readFile("./package.json", (err, data) => {
fs.readFile("./package.json", "utf-8", (err, data) => {
if (err) throw new Error(err.message);
else res(JSON.parse(data.toString()).version);
else res(JSON.parse(data).version);
});
});
}

0 comments on commit b718c9b

Please sign in to comment.