Skip to content

Commit 0768043

Browse files
committed
fix: fix dependencies updater
1 parent a15e399 commit 0768043

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

lib/package.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -879,25 +879,19 @@ export default class Package {
879879
// perform update
880880
process.stdout.write( "Updating dependencies ... " );
881881

882-
res = childProcess.spawnSync( "npm update --json", {
883-
"cwd": this.root,
884-
"stdio": [ "ignore", "pipe", "ignore" ],
885-
"shell": true,
886-
} );
887-
888-
// update failed
889-
if ( res.status ) {
890-
console.log( ansi.error( " ERROR " ) );
891-
892-
const output = JSON.parse( res.stdout );
882+
res = await this.npm.api.exec( "update" );
893883

894-
console.log( output.error.summary );
895-
console.log( output.error.detail );
896-
897-
return result( 500 );
884+
if ( res.ok ) {
885+
console.log( ansi.ok( " OK " ) );
898886
}
899887
else {
900-
console.log( ansi.ok( " OK " ) );
888+
889+
// update failed
890+
console.log( ansi.error( " ERROR " ) );
891+
console.log( res.data.error.summary );
892+
console.log( res.data.error.detail );
893+
894+
return res;
901895
}
902896

903897
// commit and push

0 commit comments

Comments
 (0)