@@ -6,6 +6,7 @@ use crate::release::changelog::ChangelogGenerator;
66use crate :: release:: planner:: { CrateReleasePlan , ReleasePlan } ;
77use crate :: release:: version:: VersionBumper ;
88use crate :: workspace:: WorkspaceContext ;
9+ use chrono:: Local ;
910use std:: fs;
1011use std:: process:: Command ;
1112use std:: thread;
@@ -206,8 +207,8 @@ impl<'a> ReleasePublisher<'a> {
206207 updated. push_str ( "\n \n " ) ;
207208 }
208209
209- // Add new version with current date (get from git commit date or system)
210- let date = self . get_current_date ( ) ? ;
210+ // Add new version with today's date
211+ let date = self . get_current_date ( ) ;
211212 updated. push_str ( & self . format_version_header ( plan, previous_tag. as_deref ( ) , & date, github_repo. as_ref ( ) ) ) ;
212213 updated. push_str ( & new_entries) ;
213214 updated. push ( '\n' ) ;
@@ -366,30 +367,9 @@ impl<'a> ReleasePublisher<'a> {
366367 Ok ( ( ) )
367368 }
368369
369- /// Get current date in YYYY-MM-DD format (using system git)
370- fn get_current_date ( & self ) -> RailResult < String > {
371- // Use git to get current date (portable across platforms)
372- let output = Command :: new ( "git" )
373- . current_dir ( self . ctx . workspace_root ( ) )
374- . args ( [ "log" , "-1" , "--format=%cd" , "--date=short" ] )
375- . output ( )
376- . map_err ( |e| RailError :: message ( format ! ( "Failed to get date: {}" , e) ) ) ?;
377-
378- if output. status . success ( ) {
379- let date = String :: from_utf8_lossy ( & output. stdout ) . trim ( ) . to_string ( ) ;
380- if !date. is_empty ( ) {
381- return Ok ( date) ;
382- }
383- }
384-
385- // Fallback: use system date command
386- let output = Command :: new ( "date" )
387- . args ( [ "+%Y-%m-%d" ] )
388- . output ( )
389- . map_err ( |e| RailError :: message ( format ! ( "Failed to get system date: {}" , e) ) ) ?;
390-
391- let date = String :: from_utf8_lossy ( & output. stdout ) . trim ( ) . to_string ( ) ;
392- Ok ( date)
370+ /// Get current date in YYYY-MM-DD format
371+ fn get_current_date ( & self ) -> String {
372+ Local :: now ( ) . format ( "%Y-%m-%d" ) . to_string ( )
393373 }
394374
395375 fn format_version_header (
0 commit comments