@@ -13,6 +13,7 @@ use semver::Version;
1313use tracing:: {
1414 error,
1515 info,
16+ warn,
1617} ;
1718
1819#[ allow( unused_imports) ]
@@ -327,7 +328,18 @@ pub async fn initialize_fig_dir(env: &fig_os_shim::Env) -> anyhow::Result<()> {
327328
328329 for old_cli_binary_name in OLD_CLI_BINARY_NAMES {
329330 let old_cli_binary_path = local_bin. join ( old_cli_binary_name) ;
330- if old_cli_binary_path. is_symlink ( ) {
331+ if old_cli_binary_name == & "q" {
332+ // Create wrapper script for q instead of symlink
333+ if let Err ( err) = fig_util:: wrapper:: create_q_wrapper ( & local_bin) . await {
334+ warn ! ( %err, "Failed to create q wrapper script" ) ;
335+ }
336+ } else if old_cli_binary_name == & "qchat" {
337+ // Create wrapper script for qchat that calls q chat
338+ if let Err ( err) = fig_util:: wrapper:: create_qchat_wrapper ( & local_bin) . await {
339+ warn ! ( %err, "Failed to create qchat wrapper script" ) ;
340+ }
341+ } else if old_cli_binary_path. is_symlink ( ) {
342+ // Handle other legacy binaries (cw) with symlinks
331343 if let Err ( err) = symlink ( & q_cli_path, & old_cli_binary_path) . await {
332344 warn ! ( %err, "Failed to symlink legacy CLI: {old_cli_binary_path:?}" ) ;
333345 }
@@ -660,6 +672,16 @@ async fn install_appimage_binaries(ctx: &Context) -> anyhow::Result<()> {
660672 }
661673 }
662674
675+ // Create q wrapper for backward compatibility
676+ if let Err ( err) = fig_util:: wrapper:: create_q_wrapper ( & home_local_bin_ctx ( ctx) ?) . await {
677+ warn ! ( %err, "Failed to create q wrapper script" ) ;
678+ }
679+
680+ // Create qchat wrapper for backward compatibility
681+ if let Err ( err) = fig_util:: wrapper:: create_qchat_wrapper ( & home_local_bin_ctx ( ctx) ?) . await {
682+ warn ! ( %err, "Failed to create qchat wrapper script" ) ;
683+ }
684+
663685 Ok ( ( ) )
664686}
665687
0 commit comments