2022-06-19 00:25:21 +00:00
|
|
|
import {Command} from "commander";
|
|
|
|
import Utils from "./utils";
|
|
|
|
import packageManager from "../plugins/packages";
|
|
|
|
import log from "../log";
|
2019-07-04 07:41:09 +00:00
|
|
|
|
2022-06-19 00:25:21 +00:00
|
|
|
const program = new Command("outdated");
|
2019-07-04 07:41:09 +00:00
|
|
|
program
|
|
|
|
.description("Check for any outdated packages")
|
|
|
|
.on("--help", Utils.extraHelp)
|
|
|
|
.action(async () => {
|
|
|
|
log.info("Checking for outdated packages");
|
|
|
|
|
|
|
|
await packageManager
|
|
|
|
.outdated(0)
|
|
|
|
.then((outdated) => {
|
|
|
|
if (outdated) {
|
|
|
|
log.info("There are outdated packages");
|
|
|
|
} else {
|
|
|
|
log.info("No outdated packages");
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch(() => {
|
|
|
|
log.error("Error finding outdated packages.");
|
|
|
|
});
|
|
|
|
});
|
2022-06-19 00:25:21 +00:00
|
|
|
|
|
|
|
export default program;
|