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

Print relative path not absolute path in logo cmd log output #2709

Merged
merged 4 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

- Update pre-commit hook astral-sh/ruff-pre-commit to v0.1.15 ([#2705](https://github.com/nf-core/tools/pull/2705))
- fix changelog titles ([#2708](https://github.com/nf-core/tools/pull/2708))
- Print relative path not absolute path in logo cmd log output ([#2709](https://github.com/nf-core/tools/pull/2709))

## [v2.12 - Aluminium Wolf](https://github.com/nf-core/tools/releases/tag/2.11) - [2024-01-29]

Expand Down
9 changes: 9 additions & 0 deletions nf_core/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ def nf_core_cli(ctx, verbose, hide_progress, log_file):
)
)

# don't show rich debug logging in verbose mode
rich_logger = logging.getLogger("rich")
mashehu marked this conversation as resolved.
Show resolved Hide resolved
rich_logger.setLevel(logging.INFO)

# Set up logs to a file if we asked for one
if log_file:
log_fh = logging.FileHandler(log_file, encoding="utf-8")
Expand Down Expand Up @@ -2068,6 +2072,11 @@ def logo(logo_text, dir, name, theme, width, format, force):
if dir == ".":
dir = Path.cwd()
logo_path = create_logo(logo_text, dir, name, theme, width, format, force)
# Print path to logo relative to current working directory
try:
logo_path = Path(logo_path).relative_to(Path.cwd())
except ValueError:
logo_path = Path(logo_path)
log.info(f"Created logo: [magenta]{logo_path}[/]")
except UserWarning as e:
log.error(e)
Expand Down
2 changes: 1 addition & 1 deletion nf_core/create_logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def create_logo(
# Save
img.save(logo_path, "PNG")

log.debug(f"Saved logo to: {logo_path}")
log.debug(f"Saved logo to: '{logo_path}'")

# Return the logo
return logo_path
Loading