Skip to content

Commit ae590bd

Browse files
committed
Enhance FEAScriptVersion function: update to fetch latest release and commit date from GitHub, improving version information output.
1 parent d70d28c commit ae590bd

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/utilities/helperFunctionsScript.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@
99
// Website: https://feascript.com/ \__| //
1010

1111
/**
12-
* Function to handle version information
12+
* Function to handle version information and fetch the latest update date and release from GitHub
1313
*/
14-
export function FEAScriptVersion() {
15-
console.log("FEAScript version 0.1.0");
14+
export async function FEAScriptVersion() {
15+
// Fetch the latest release information
16+
const releaseResponse = await fetch('https://api.github.com/repos/FEAScript/FEAScript/releases/latest');
17+
const releaseData = await releaseResponse.json();
18+
console.log(`FEAScript version: ${releaseData.tag_name} - ${releaseData.name}`);
19+
//console.log(`Release date: ${new Date(releaseData.published_at).toLocaleString()}`);
20+
21+
// Fetch the latest commit date
22+
const commitResponse = await fetch('https://api.github.com/repos/FEAScript/FEAScript/commits/main');
23+
const commitData = await commitResponse.json();
24+
const latestCommitDate = new Date(commitData.commit.committer.date).toLocaleString();
25+
console.log(`Latest FEAScript update: ${latestCommitDate}`);
1626
}

0 commit comments

Comments
 (0)