File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 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}
You can’t perform that action at this time.
0 commit comments