File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,15 @@ fn install_one(
146
146
no_track : bool ,
147
147
is_first_install : bool ,
148
148
) -> CargoResult < ( ) > {
149
+ if let Some ( name) = krate {
150
+ if name == "." {
151
+ bail ! (
152
+ "To install the binaries for the package in current working \
153
+ directory use `cargo install --path .`. \
154
+ Use `cargo build` if you want to simply build the package."
155
+ )
156
+ }
157
+ }
149
158
let pkg = if source_id. is_git ( ) {
150
159
select_pkg (
151
160
GitSource :: new ( source_id, config) ?,
Original file line number Diff line number Diff line change @@ -151,6 +151,20 @@ fn missing() {
151
151
. run ( ) ;
152
152
}
153
153
154
+ #[ cargo_test]
155
+ fn missing_current_working_directory ( ) {
156
+ cargo_process ( "install ." )
157
+ . with_status ( 101 )
158
+ . with_stderr (
159
+ "\
160
+ error: To install the binaries for the package in current working \
161
+ directory use `cargo install --path .`. Use `cargo build` if you \
162
+ want to simply build the package.
163
+ " ,
164
+ )
165
+ . run ( ) ;
166
+ }
167
+
154
168
#[ cargo_test]
155
169
fn bad_version ( ) {
156
170
pkg ( "foo" , "0.0.1" ) ;
You can’t perform that action at this time.
0 commit comments