瀏覽代碼

Warn users of missing composer.json

Jordi Boggiano 13 年之前
父節點
當前提交
e00e6cddbe
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      bin/composer

+ 3 - 0
bin/composer

@@ -34,6 +34,9 @@ $im->addInstaller(new Installer\LibraryInstaller($vendorPath.'/bundles', $dm, $r
 // load package
 $loader  = new Package\Loader\ArrayLoader($rm);
 $file = new JsonFile('composer.json');
+if (!$file->exists()) {
+    throw new \RuntimeException('The composer.json file could not be found in the current directory');
+}
 $packageConfig = $file->read();
 $package = $loader->load($packageConfig);