File tree Expand file tree Collapse file tree 2 files changed +26
-23
lines changed Expand file tree Collapse file tree 2 files changed +26
-23
lines changed Original file line number Diff line number Diff line change @@ -183,29 +183,29 @@ impl IRust {
183
183
// Note this might be a bit too aggressive (an argument might be canonicalized, that the user didn't not intend for it to be considered as a path)
184
184
// But the usefulness of this trick, outways this possible edge case
185
185
// canonicalize is problamatic on windows -> need to handle extended path
186
- #[ cfg( unix) ]
187
- for p in dep. iter_mut ( ) {
188
- let path = std:: path:: Path :: new ( p) ;
189
- if path. exists ( ) {
190
- if let Ok ( full_path) = path. canonicalize ( ) {
191
- if let Some ( full_path) = full_path. to_str ( ) {
192
- * p = full_path. to_string ( ) ;
193
- }
194
- }
195
- }
196
- }
186
+ // #[cfg(unix)]
187
+ // for p in dep.iter_mut() {
188
+ // let path = std::path::Path::new(p);
189
+ // if path.exists() {
190
+ // if let Ok(full_path) = path.canonicalize() {
191
+ // if let Some(full_path) = full_path.to_str() {
192
+ // *p = full_path.to_string();
193
+ // }
194
+ // }
195
+ // }
196
+ // }
197
197
// But still the most common case is `:add .` so we can special case that
198
- #[ cfg( windows) ]
199
- for p in dep. iter_mut ( ) {
200
- if p == "." {
201
- * p = self
202
- . global_variables
203
- . get_cwd ( )
204
- . to_str ( )
205
- . ok_or ( "Error parsing path to dependecy" ) ?
206
- . to_string ( ) ;
207
- }
208
- }
198
+ // #[cfg(windows)]
199
+ // for p in dep.iter_mut() {
200
+ // if p == "." {
201
+ // *p = self
202
+ // .global_variables
203
+ // .get_cwd()
204
+ // .to_str()
205
+ // .ok_or("Error parsing path to dependecy")?
206
+ // .to_string();
207
+ // }
208
+ // }
209
209
210
210
self . wait_add ( self . repl . add_dep ( & dep) ?, "Add" ) ?;
211
211
self . wait_add ( self . repl . build ( ) ?, "Build" ) ?;
Original file line number Diff line number Diff line change @@ -178,9 +178,12 @@ edition = \"2021\""
178
178
179
179
pub fn cargo_add ( & self , dep : & [ String ] ) -> io:: Result < std:: process:: Child > {
180
180
Command :: new ( "cargo" )
181
- . current_dir ( & self . paths . irust_dir )
182
181
. arg ( "add" )
183
182
. args ( dep)
183
+ . args ( & [
184
+ "--manifest-path" ,
185
+ & self . paths . cargo_toml_file . display ( ) . to_string ( ) ,
186
+ ] )
184
187
. stdout ( std:: process:: Stdio :: null ( ) )
185
188
. stderr ( std:: process:: Stdio :: piped ( ) )
186
189
. spawn ( )
You can’t perform that action at this time.
0 commit comments