Skip to content

Commit

Permalink
fix: explicitly use utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Aug 21, 2020
1 parent aea7f93 commit 5971544
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/agoric-cli/lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function installMain(progname, rawArgs, powers, opts) {
allPackages.map(async pkg => {
const dir = `${sdkPackagesDir}/${pkg}`;
const packageJSON = await fs
.readFile(`${dir}/package.json`)
.readFile(`${dir}/package.json`, 'utf-8')
.catch(err => log('error reading', `${dir}/package.json`, err));
if (!packageJSON) {
return undefined;
Expand Down Expand Up @@ -83,7 +83,9 @@ export default async function installMain(progname, rawArgs, powers, opts) {

// Mark all the SDK package dependencies as wildcards.
const pjson = `${subdir}/package.json`;
const packageJSON = await fs.readFile(pjson).catch(_ => undefined);
const packageJSON = await fs
.readFile(pjson, 'utf-8')
.catch(_ => undefined);
if (!packageJSON) {
return;
}
Expand All @@ -92,8 +94,7 @@ export default async function installMain(progname, rawArgs, powers, opts) {
const deps = pj[section];
if (deps) {
for (const pkg of Object.keys(deps)) {
const latest = versions.get(pkg);
if (latest) {
if (versions.has(pkg)) {
deps[pkg] = `*`;
}
}
Expand Down

0 comments on commit 5971544

Please sign in to comment.