Skip to content

Commit

Permalink
πŸ› Fix check-dep script
Browse files Browse the repository at this point in the history
  • Loading branch information
coyotte508 committed Oct 30, 2024
1 parent 32a56ea commit 47039dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/check-deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ if (!dep) {

process.chdir(`./packages/${dep}`);

const localVersion = JSON.parse(readFileSync(`./package.json`, "utf-8")).version as string;
const localPackageJson = readFileSync(`./package.json`, "utf-8");
const localVersion = JSON.parse(localPackageJson).version as string;
const remoteVersion = execSync(`npm view @huggingface/${dep} version`).toString().trim();

if (localVersion !== remoteVersion) {
Expand All @@ -34,6 +35,10 @@ execSync(`mv huggingface-${dep}-${remoteVersion}.tgz ${dep}-remote.tgz`);
execSync(`rm -Rf local && mkdir local && tar -xf ${dep}-local.tgz -C local`);
execSync(`rm -Rf remote && mkdir remote && tar -xf ${dep}-remote.tgz -C remote`);

// Remove package.json files because they're modified by npm
execSync(`rm local/package/package.json`);
execSync(`rm remote/package/package.json`);

try {
execSync("diff --brief -r local remote").toString();
} catch (e) {
Expand Down

0 comments on commit 47039dc

Please sign in to comment.