Print warning when invoking `bazel version` outside of a workspace.
Fixes
Closes
@@ -1639,6 +1639,10 @@ int Main(int argc, const char *const *argv, WorkspaceLayout *workspace_layout,
// than emit a help message.
if (!workspace_layout->InWorkspace(workspace)) {
startup_options->batch = true;
+ BAZEL_LOG(WARNING) << "Invoking " << startup_options->product_name
+ << " in batch mode since it is not invoked from within"
+ << " a workspace (below a directory having a WORKSPACE"
+ << " file).";
}
vector<string> archive_contents;
