Fix passing utf-8 to readFileSync

This commit is contained in:
Pavel Djundik 2020-01-01 01:11:04 +02:00
parent 84107ab516
commit 0c246f0bbe
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ program
// Get paths to the location of packages directory
const packagesConfig = path.join(Helper.getPackagesPath(), "package.json");
const packagesList = JSON.parse(fs.readFileSync(packagesConfig), "utf-8").dependencies;
const packagesList = JSON.parse(fs.readFileSync(packagesConfig, "utf-8")).dependencies;
const argsList = ["upgrade", "--latest"];
let count = 0;

View file

@ -172,7 +172,7 @@ async function outdated(cacheTimeout = TIME_TO_LIVE) {
// Get paths to the location of packages directory
const packagesPath = Helper.getPackagesPath();
const packagesConfig = path.join(packagesPath, "package.json");
const packagesList = JSON.parse(fs.readFileSync(packagesConfig), "utf-8").dependencies;
const packagesList = JSON.parse(fs.readFileSync(packagesConfig, "utf-8")).dependencies;
const argsList = [
"outdated",
"--latest",