Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

status: Show friendly message for empty project. #4609

Merged
merged 4 commits into from
Sep 25, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dvc/command/status.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging

import colorama

from dvc.command.data_sync import CmdDataBase
from dvc.exceptions import DvcException

Expand All @@ -10,6 +12,10 @@ class CmdDataStatus(CmdDataBase):
STATUS_LEN = 20
STATUS_INDENT = "\t"
UP_TO_DATE_MSG = "Data and pipelines are up to date."
EMPTY_PROJECT_MSG = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use format_link?

def format_link(link):

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't argue with that. Fixed in 656efd5.

"There is no data tracked in this project yet.\n"
"See {bl}https://dvc.org/doc/start/data-versioning{nc} to get started!"
).format(bl=colorama.Fore.BLUE, nc=colorama.Fore.RESET)

def _normalize(self, s):
s += ":"
Expand Down Expand Up @@ -61,6 +67,8 @@ def run(self):
logger.info(json.dumps(st))
elif st:
self._show(st, indent)
elif not self.repo.stages:
logger.info(self.EMPTY_PROJECT_MSG)
else:
logger.info(self.UP_TO_DATE_MSG)
skshetry marked this conversation as resolved.
Show resolved Hide resolved

Expand Down