Skip to content

Commit

Permalink
fix: fix import update-notifier
Browse files Browse the repository at this point in the history
Signed-off-by: dhmlau <dhmlau@ca.ibm.com>
  • Loading branch information
dhmlau committed Dec 12, 2023
1 parent 73a58da commit 565fc1f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
15 changes: 10 additions & 5 deletions packages/cli/bin/cli-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,17 @@ if (tabCompletionCommands.includes(originalCommand)) {
}

const main = require('../lib/cli');
const updateNotifier = require('update-notifier');

// Force version check with `lb4 --version`
const interval = opts.version ? 0 : undefined;
updateNotifier({
pkg: pkg,
updateCheckInterval: interval,
}).notify({isGlobal: true});

import('update-notifier')
.then(({default: updateNotifier}) => {
updateNotifier({
pkg: pkg,
updateCheckInterval: interval,
}).notify({isGlobal: true});
})
.catch(() => {});

main(opts);
20 changes: 10 additions & 10 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@
"config": {
"templateDependencies": {
"tslib": "^2.0.0",
"@types/mocha": "^10.0.1",
"@types/node": "^16.18.50",
"@types/mocha": "^10.0.6",
"@types/node": "^16.18.68",
"cross-spawn": "^7.0.3",
"debug": "^4.3.4",
"fs-extra": "^11.1.1",
"fs-extra": "^11.2.0",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"prettier": "^3.0.2",
"rimraf": "^5.0.1",
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"source-map-support": "^0.5.21",
"typescript": "~5.2.2",
"@loopback/authentication": "^10.1.3",
Expand All @@ -131,7 +131,7 @@
"@loopback/rest": "^13.1.3",
"@loopback/testlab": "^6.1.3",
"@loopback/docs": "^6.0.4",
"glob": "^10.3.4",
"glob": "^10.3.10",
"@loopback/example-hello-world": "^6.1.3",
"@loopback/example-log-extension": "^6.1.3",
"@loopback/example-rpc-server": "^6.1.3",
Expand All @@ -149,12 +149,12 @@
"@loopback/example-greeter-extension": "^6.1.3",
"@loopback/booter-lb3app": "^5.1.3",
"@loopback/example-lb3-application": "^6.1.3",
"eslint": "^8.48.0",
"eslint-plugin-mocha": "^10.1.0",
"eslint": "^8.51.0",
"eslint-plugin-mocha": "^10.2.0",
"@loopback/example-greeting-app": "^6.1.3",
"@loopback/example-context": "^6.1.3",
"@typescript-eslint/eslint-plugin": "^6.4.1",
"@typescript-eslint/parser": "^6.4.1",
"@typescript-eslint/eslint-plugin": "^6.8.0",
"@typescript-eslint/parser": "^6.8.0",
"eslint-plugin-eslint-plugin": "^5.1.1",
"eslint-config-prettier": "^9.0.0",
"@loopback/repository-tests": "^0.23.3",
Expand Down

0 comments on commit 565fc1f

Please sign in to comment.