Skip to content

Commit

Permalink
Merge pull request #2709 from mashehu/output-path-for-logo
Browse files Browse the repository at this point in the history
Print relative path not absolute path in logo cmd log output
  • Loading branch information
mashehu authored Jan 31, 2024
2 parents 58c7088 + c2eb9ac commit c149db5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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")
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

0 comments on commit c149db5

Please sign in to comment.