@@ -1363,7 +1363,7 @@ async fn run_new(args: PluginNewArgs) -> Result<()> {
13631363
13641364 println ! ( "\n Plugin created successfully!" ) ;
13651365 println ! ( "\n Next steps:" ) ;
1366- println ! ( " cd {}" , args . name ) ;
1366+ println ! ( " cd {}" , plugin_new_cd_target ( & plugin_dir ) ) ;
13671367 if args. typescript {
13681368 println ! ( " npm install" ) ;
13691369 println ! ( " npm run build" ) ;
@@ -1376,6 +1376,10 @@ async fn run_new(args: PluginNewArgs) -> Result<()> {
13761376 Ok ( ( ) )
13771377}
13781378
1379+ fn plugin_new_cd_target ( plugin_dir : & Path ) -> String {
1380+ plugin_dir. display ( ) . to_string ( )
1381+ }
1382+
13791383// =============================================================================
13801384// Dev Command Implementation
13811385// =============================================================================
@@ -2966,6 +2970,17 @@ mod tests {
29662970 ) ;
29672971 }
29682972
2973+ #[ test]
2974+ fn test_plugin_new_cd_target_uses_created_directory ( ) {
2975+ let plugin_dir = PathBuf :: from ( "custom-output" ) . join ( "output-plugin" ) ;
2976+
2977+ assert_eq ! (
2978+ plugin_new_cd_target( & plugin_dir) ,
2979+ plugin_dir. display( ) . to_string( ) ,
2980+ "cd target should match the created plugin directory"
2981+ ) ;
2982+ }
2983+
29692984 #[ test]
29702985 fn test_plugin_new_args_debug ( ) {
29712986 let args = PluginNewArgs {
0 commit comments