Skip to content

Commit

Permalink
Adding 'yarn global upgrade'(Issue #776) (#1616)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pushkaraj Shinde authored and Sebastian McKenzie committed Nov 2, 2016
1 parent 855b45a commit ebe8993
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/cli/commands/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Lockfile from '../../lockfile/wrapper.js';
import {Install} from './install.js';
import {Add} from './add.js';
import {run as runRemove} from './remove.js';
import {run as runUpgrade} from './upgrade.js';
import {linkBin} from '../../package-linker.js';
import * as fs from '../../util/fs.js';

Expand Down Expand Up @@ -219,4 +220,21 @@ export const {run, setFlags} = buildSubCommands('global', {
// remove binaries
await updateBins();
},

async upgrade(
config: Config,
reporter: Reporter,
flags: Object,
args: Array<string>,
): Promise<void> {
await updateCwd(config);

const updateBins = await initUpdateBins(config, reporter);

// upgrade module
await runUpgrade(config, reporter, flags, args);

// update binaries
await updateBins();
},
});

0 comments on commit ebe8993

Please sign in to comment.