diff --git a/source/app.d b/source/app.d index d64ae81..6d0b761 100644 --- a/source/app.d +++ b/source/app.d @@ -122,6 +122,16 @@ break; case "run": case "build": + if( !existsFile("package.json") && !existsFile("source/app.d") ){ + logInfo(""); + logInfo("Neither package.json, nor source/app.d was found in the current directory."); + logInfo("Please run dub from the root directory of an existing package, or create a new"); + logInfo("package using \"dub init \"."); + logInfo(""); + showHelp(null); + return 1; + } + dub.loadPackageFromCwd(); auto def_config = dub.getDefaultConfiguration(build_platform); if( !build_config.length ) build_config = def_config;