Skip to content

Commit 5730c19

Browse files
committed
Merge branch 'feature/version-command'
2 parents 96a3ced + bff5c8b commit 5730c19

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

commands/core/version.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export async function getLatestVersion() {
2+
try {
3+
const latestVersion = "0.1.0";
4+
console.log(latestVersion);
5+
return latestVersion;
6+
} catch (error) {
7+
console.error(`Error while retrieving the latest version. No release found.\n ${error}`);
8+
}
9+
}
10+
11+
export function checkVersion(currentVersion) {
12+
getLatestVersion().then((latestVersion) => {
13+
if (currentVersion < latestVersion) {
14+
console.log(`A new update is available: ${latestVersion}`);
15+
} else {
16+
console.log(`You have the latest version of the code.`);
17+
}
18+
});
19+
}

0 commit comments

Comments
 (0)