Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Load update notifier dynamically

Jakub Novak429ec0366fa3
diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts
index 76cb6ec11..dac5762e6 100644
--- a/packages/cli/src/index.ts
+++ b/packages/cli/src/index.ts
@@ -1,7 +1,5 @@
#!/usr/bin/env -S node --enable-source-maps
-import * as updateNotifier from 'update-notifier'
-
import * as commander from 'commander'
import * as packageJSON from '../package.json'
import { program } from './commands'
@@ -9,12 +7,18 @@ import { commands2md } from './utils/commands2md'
export const pkg = packageJSON
-updateNotifier
- .default({
- pkg,
- updateCheckInterval: 1000 * 60 * 60 * 8, // 8 hours
- })
- .notify()
+async function loadUpdateNotifier() {
+ const updateNotifier = await import('update-notifier');
+ return updateNotifier.default;
+}
+
+loadUpdateNotifier().then(updateNotifier => {
+ updateNotifier({
+ pkg,
+ updateCheckInterval:1000 * 60 * 60 * 8, // 8 hours
+ })
+ .notify()
+})
const prog = program.version(
packageJSON.version,