@@ -75,23 +75,27 @@ pub fn prepare(dir: PathBuf) -> Result<()> {
75
75
"no '[package]' section in manifest" . to_string( )
76
76
) ) ,
77
77
} ;
78
- // Replace the relative path references to Perseus packages
79
- // Also update the name of the user's crate (Cargo needs more than just a path and an alias)
78
+ // Update the name of the user's crate (Cargo needs more than just a path and an alias)
80
79
// Also add an empty `[workspace]` key so we exclude from any of the user's workspace settings
81
80
let updated_root_manifest = root_manifest_contents
82
- . replace (
83
- "{ path = \" ../../../packages/perseus\" }" ,
84
- & format ! ( "\" {}\" " , PERSEUS_VERSION ) ,
85
- )
86
81
. replace ( "perseus-example-cli" , & user_crate_name)
87
82
+ "\n [workspace]" ;
88
83
let updated_server_manifest = server_manifest_contents
89
- . replace (
90
- "{ path = \" ../../../../packages/perseus-actix-web\" }" ,
91
- & format ! ( "\" {}\" " , PERSEUS_VERSION ) ,
92
- )
93
84
. replace ( "perseus-example-cli" , & user_crate_name)
94
85
+ "\n [workspace]" ;
86
+
87
+ // If we're not in development, also update relative path references
88
+ #[ cfg( not( debug_assertions) ) ]
89
+ let updated_root_manifest = updated_root_manifest. replace (
90
+ "{ path = \" ../../../packages/perseus\" }" ,
91
+ & format ! ( "\" {}\" " , PERSEUS_VERSION ) ,
92
+ ) ;
93
+ #[ cfg( not( debug_assertions) ) ]
94
+ let updated_server_manifest = updated_server_manifest. replace (
95
+ "{ path = \" ../../../../packages/perseus-actix-web\" }" ,
96
+ & format ! ( "\" {}\" " , PERSEUS_VERSION ) ,
97
+ ) ;
98
+
95
99
// Write the updated manifests back
96
100
if let Err ( err) = fs:: write ( & root_manifest, updated_root_manifest) {
97
101
bail ! ( ErrorKind :: ManifestUpdateFailed (
0 commit comments