Skip to content

Commit 8326868

Browse files
authored
Minor fix for fpm new (#739)
- Do not query fpm.toml file location for fpm new command
1 parent 0ffd8cc commit 8326868

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

app/main.f90

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,24 @@ program main
4646
pwd_working = pwd_start
4747
end if
4848

49-
if (.not.has_manifest(pwd_working)) then
50-
project_root = pwd_working
51-
do while(.not.has_manifest(project_root))
52-
working_dir = parent_dir(project_root)
53-
if (len(working_dir) == 0) exit
54-
project_root = working_dir
55-
end do
56-
57-
if (has_manifest(project_root)) then
58-
call change_directory(project_root, error)
59-
call handle_error(error)
60-
write(output_unit, '(*(a))') "fpm: Entering directory '"//project_root//"'"
49+
select type (settings => cmd_settings)
50+
type is (fpm_new_settings)
51+
class default
52+
if (.not.has_manifest(pwd_working)) then
53+
project_root = pwd_working
54+
do while(.not.has_manifest(project_root))
55+
working_dir = parent_dir(project_root)
56+
if (len(working_dir) == 0) exit
57+
project_root = working_dir
58+
end do
59+
60+
if (has_manifest(project_root)) then
61+
call change_directory(project_root, error)
62+
call handle_error(error)
63+
write(output_unit, '(*(a))') "fpm: Entering directory '"//project_root//"'"
64+
end if
6165
end if
62-
end if
66+
end select
6367

6468
select type(settings=>cmd_settings)
6569
type is (fpm_new_settings)

0 commit comments

Comments
 (0)