diff --git a/source/dub/commandline.d b/source/dub/commandline.d index 84186df..077b9f6 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -427,18 +427,18 @@ private bool loadCwdPackage(Dub dub, bool warn_missing_package) { - bool found = existsFile(dub.rootPath ~ "source/app.d"); - if (!found) - foreach (f; packageInfoFiles) - if (existsFile(dub.rootPath ~ f.filename)) { - found = true; - break; - } + bool found; + foreach (f; packageInfoFiles) + if (existsFile(dub.rootPath ~ f.filename)) + { + found = true; + break; + } if (!found) { if (warn_missing_package) { logInfo(""); - logInfo("Neither a package description file, nor source/app.d was found in"); + logInfo("No package manifest (dub.json or dub.sdl) was found in"); logInfo(dub.rootPath.toNativeString()); logInfo("Please run DUB from the root directory of an existing package, or run"); logInfo("\"dub init --help\" to get information on creating a new package."); diff --git a/test/issue1277.sh b/test/issue1277.sh new file mode 100755 index 0000000..5471c8d --- /dev/null +++ b/test/issue1277.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +. $(dirname "${BASH_SOURCE[0]}")/common.sh + +cd ${CURR_DIR}/issue1003-check-empty-ld-flags + +# It should fail +! ${DUB} --root=${CURR_DIR}/issue1277/ build diff --git a/test/issue1277/.no_build b/test/issue1277/.no_build new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/issue1277/.no_build diff --git a/test/issue1277/source/app.d b/test/issue1277/source/app.d new file mode 100644 index 0000000..ab73b3a --- /dev/null +++ b/test/issue1277/source/app.d @@ -0,0 +1 @@ +void main() {}