Skip to content

Conversation

o2sh
Copy link
Owner

@o2sh o2sh commented Jun 7, 2025

fix for #1578 (opened by @Kajiih)

With this PR, we can now display project information even if no source code is detected.

I have added a PrinterFactory that handles the logic of creating the appropriate printer depending on the context:

  • JsonPrinter and YamlPrinter printers if --output is used
  • PlainPrinter (no ASCII art, just info lines) when the --no-art option is used, or when no source code is detected and no --ascii-input is provided
  • ImagePrinter if --image is provided and the terminal supports it
  • AsciiPrinter as the default case, displaying the dominant language (or override), or if --ascii-input is provided
@o2sh o2sh added the fix label Jun 7, 2025
@o2sh o2sh marked this pull request as ready for review June 7, 2025 22:46
Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

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

LGTM! Just some nitpicks and thoughts.

Copy link
Collaborator

@spenserblack spenserblack left a comment

Choose a reason for hiding this comment

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

LGTM (again)!

@o2sh o2sh merged commit c38a6b5 into main Jun 10, 2025
4 checks passed
@o2sh o2sh deleted the fix/no-code-repo branch June 10, 2025 17:35
@o2sh o2sh added feat and removed fix labels Jul 5, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 6, 2025
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [o2sh/onefetch](https://github.com/o2sh/onefetch) | minor | `2.24.0` -> `2.25.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>o2sh/onefetch (o2sh/onefetch)</summary> ### [`v2.25.0`](https://github.com/o2sh/onefetch/releases/tag/2.25.0) [Compare Source](o2sh/onefetch@2.24.0...2.25.0) <!-- Release notes generated using configuration in .github/release.yml at main --> #### What's Changed ##### New Features - add language support for Lean by [@&#8203;Kajiih](https://github.com/Kajiih) in o2sh/onefetch#1579 - support repos "without source code" by [@&#8203;o2sh](https://github.com/o2sh) in o2sh/onefetch#1580 ##### Chores - improve error handling by [@&#8203;Mahdiglm](https://github.com/Mahdiglm) in o2sh/onefetch#1560 ##### Bug Fixes - remove extra line break by [@&#8203;o2sh](https://github.com/o2sh) in [`886d942`](o2sh/onefetch@886d942) #### New Contributors - [@&#8203;Mahdiglm](https://github.com/Mahdiglm) made their first contribution in o2sh/onefetch#1560 - [@&#8203;Kajiih](https://github.com/Kajiih) made their first contribution in o2sh/onefetch#1579 **Full Changelog**: o2sh/onefetch@2.24.0...2.25.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants