File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed
Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { verbosityToLevel } from "../services/output/log/level.js";
55import { println } from "../services/output/print.js" ;
66import { reportErrorAndExit } from "../services/output/report.js" ;
77import { sprint } from "../services/output/sprint.js" ;
8- import { warnIfUpdateAvailable } from "../services/output/update.js" ;
8+ import { shouldCheckForUpdate } from "../services/output/update.js" ;
99import { sortBySimilar } from "../services/util/collection.js" ;
1010import { isNil } from "../services/util/is.js" ;
1111
@@ -64,7 +64,10 @@ export const run: Run<RootArgs> = async (parent, args): Promise<void> => {
6464 process . env [ "GGT_LOG_LEVEL" ] = verbosityToLevel ( args [ "--verbose" ] ) . toString ( ) ;
6565 }
6666
67- await warnIfUpdateAvailable ( ctx ) ;
67+ if ( await shouldCheckForUpdate ( ctx ) ) {
68+ const { warnIfUpdateAvailable } = await import ( "../services/output/update.js" ) ;
69+ await warnIfUpdateAvailable ( ctx ) ;
70+ }
6871
6972 let commandName = args . _ . shift ( ) ;
7073 if ( isNil ( commandName ) ) {
Original file line number Diff line number Diff line change @@ -60,11 +60,6 @@ export const shouldCheckForUpdate = async (ctx: Context): Promise<boolean> => {
6060 */
6161export const warnIfUpdateAvailable = async ( ctx : Context ) : Promise < void > => {
6262 try {
63- const shouldCheck = await shouldCheckForUpdate ( ctx ) ;
64- if ( ! shouldCheck ) {
65- return ;
66- }
67-
6863 await fs . outputFile ( path . join ( config . cacheDir , "last-update-check" ) , String ( Date . now ( ) ) ) ;
6964
7065 const tags = await getDistTags ( ctx ) ;
You can’t perform that action at this time.
0 commit comments