File tree 2 files changed +4
-3
lines changed
v-next/hardhat/src/internal/cli/init
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
readJsonFile ,
14
14
writeJsonFile ,
15
15
} from "@ignored/hardhat-vnext-utils/fs" ;
16
+ import { resolveFromRoot } from "@ignored/hardhat-vnext-utils/path" ;
16
17
import chalk from "chalk" ;
17
18
18
19
import { findClosestHardhatConfig } from "../../config-loading.js" ;
@@ -169,7 +170,7 @@ export async function getWorkspace(workspace?: string): Promise<string> {
169
170
workspace = await promptForWorkspace ( ) ;
170
171
}
171
172
172
- workspace = path . resolve ( workspace ) ;
173
+ workspace = resolveFromRoot ( process . cwd ( ) , workspace ) ;
173
174
174
175
if ( ! ( await exists ( workspace ) ) || ! ( await isDirectory ( workspace ) ) ) {
175
176
throw new HardhatError ( HardhatError . ERRORS . GENERAL . WORKSPACE_NOT_FOUND , {
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ export async function promptForWorkspace(): Promise<string> {
11
11
{
12
12
name : "workspace" ,
13
13
type : "input" ,
14
- message : " Where would you like to initialize the project?" ,
15
- initial : process . cwd ( ) ,
14
+ message : ` Where would you like to initialize the project?\n\nPlease provide either a path relative to ${ process . cwd ( ) } or an absolute path:` ,
15
+ initial : "." ,
16
16
} ,
17
17
] ) ;
18
18
You can’t perform that action at this time.
0 commit comments