Skip to content

Commit 518dff2

Browse files
authored
add notice for new packages (#27)
1 parent 96fc2f9 commit 518dff2

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

22
**[Current]**
3+
1.2.3:
4+
- Zeus automatically displays messages indicating the user should upgrade now.
5+
36
1.2.2:
47
- A bug which resulted in etherscanApiKey not being prompted.
58

package-lock.json

+10-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@layr-labs/zeus",
3-
"version": "1.2.2",
3+
"version": "1.2.3",
44
"description": "web3 deployer / metadata manager",
55
"main": "src/index.ts",
66
"scripts": {
@@ -46,6 +46,7 @@
4646
"cli-spinners": "^3.2.0",
4747
"clipboardy": "^4.0.0",
4848
"cmd-ts": "^0.13.0",
49+
"compare-versions": "^6.1.1",
4950
"express": "^4.21.0",
5051
"glob": "^11.0.0",
5152
"loading-spinner": "^1.2.1",

src/index.ts

+13
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,21 @@ import testCmd from './commands/test';
1313
import initCmd from './commands/init';
1414
import which from './commands/which';
1515
import {zeus as zeusInfo} from './metadata/meta';
16+
import pkgInfo from '../package.json';
17+
import { execSync } from 'child_process';
18+
import { compare } from 'compare-versions';
1619

1720
const main = async () => {
21+
const latestRemoteVersion = execSync(`npm view ${pkgInfo.name} version`).toString().trim();
22+
const currentVersion = pkgInfo.version;
23+
24+
if (compare(latestRemoteVersion, currentVersion, '>')) {
25+
console.log(chalk.yellow(`==================================================`))
26+
console.log(chalk.yellow(`A new version (${latestRemoteVersion}) is available!\n`))
27+
console.log(chalk.bold.yellow(`\tnpm install -g @layr-labs/zeus`))
28+
console.log(chalk.yellow(`==================================================`))
29+
}
30+
1831
const state = await load()
1932
const isLoggedIn = await state.metadataStore?.isLoggedIn() ?? false;
2033
const hasZeusHost = !!state?.zeusHostOwner;

0 commit comments

Comments
 (0)