{"id":16940757,"url":"https://github.com/halostatue/fish-utils-core","last_synced_at":"2025-07-20T19:32:37.484Z","repository":{"id":58487157,"uuid":"270530129","full_name":"halostatue/fish-utils-core","owner":"halostatue","description":"Core fish utilities","archived":false,"fork":false,"pushed_at":"2025-07-15T02:16:31.000Z","size":91,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-15T06:50:06.247Z","etag":null,"topics":["fish","fish-plugin","fish-shell","fisher"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/halostatue.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"halostatue","buy_me_a_coffee":"halostatue","ko_fi":"halostatue","tidelift":"rubygems/diff-lcs"}},"created_at":"2020-06-08T04:37:14.000Z","updated_at":"2025-07-15T02:16:33.000Z","dependencies_parsed_at":"2025-01-21T06:19:33.375Z","dependency_job_id":"77494883-2127-4628-8516-c45385177b31","html_url":"https://github.com/halostatue/fish-utils-core","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/halostatue/fish-utils-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-utils-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-utils-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-utils-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-utils-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halostatue","download_url":"https://codeload.github.com/halostatue/fish-utils-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halostatue%2Ffish-utils-core/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266187165,"owners_count":23889925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fish","fish-plugin","fish-shell","fisher"],"created_at":"2024-10-13T21:07:52.456Z","updated_at":"2025-07-20T19:32:37.477Z","avatar_url":"https://github.com/halostatue.png","language":"Shell","funding_links":["https://github.com/sponsors/halostatue","https://buymeacoffee.com/halostatue","https://ko-fi.com/halostatue","https://tidelift.com/funding/github/rubygems/diff-lcs"],"categories":[],"sub_categories":[],"readme":"# halostatue/fish-utils-core\n\n[![Version][version]](https://github.com/halostatue/fish-utils-core/releases)\n\nCore utility functions for [fish shell][shell].\n\n## Installation\n\nInstall with [Fisher][Fisher]:\n\n```fish\nfisher install halostatue/fish-utils-core@v3\n```\n\n### System Requirements\n\n- [fish][fish] 3.4+\n\n## Functions\n\n### `is_os` -- `is_freebsd`, `is_linux`, `is_mac`, `is_ubuntu`\n\nTests that the current operating environment is the expected OS type. Most are\nimplemented in terms of `is_os`, which is mostly a comparison tool for\n`uname -s`.\n\n- `is_mac` can also test for a specific version of macOS by name or version.\n\n- `is_linux` can also test for a specific distribution based on the `ID` or\n  `ID_LIKE` values from `/etc/os-release`. Values tested include `rhel`,\n  `fedora`, `debian`, `ubuntu`, and `alpine`.\n\n```fish\nis_mac; and echo Yes; or echo No\nis_mac sequoia; and echo Sequoia; or echo Not macOS or Sequoia\n```\n\n### `is_mac_terminal`\n\nReturns true if `fish` is running on macOS and in a recognized terminal based on\nthe terminal bundle ID as reported in `$__CFBundleId`.\n\nCurrently, Alacritty, iTerm2, Apple Terminal, kitty, Wezterm, and GhosTTY are\nrecognized. Contributions are welcome to expand this.\n\n### `list_unique`\n\nEnsures that each of the values in the provided list is uniquely represented,\nremoving second or subsequent copies of the values and preserving order.\n\n```fish\nlist_unique b a c a b # =\u003e b a c\nset PATH (list_unique $PATH)\n```\n\n#### `list_unique` flags\n\n- `-t TYPE`, `--type TYPE`: Checks each value of the list to see if the value\n  represents one of the provided `TYPE`s. May be specified multiple times.\n  Supported `TYPE` values are:\n\n  - `d`: an existing directory\n  - `f`: an existing file\n\n- `-d`, `--directory`: Shorthand for `--type d`.\n\n- `-f`, `--file`: Shorthand for `--type f`.\n\n### `list_clean`\n\nRemoves the first list of values from the second list of values. This _requires_\nthat the `--` parameter be supplied to separate the lists. Roughly equivalent to\n`set -e list[(contains -i value $list)]`, except that the first part can also be\na list.\n\n```fish\nlist_clean a b c -- a b c d e f # =\u003e d e f\n```\n\n### `__macos_version_to_comparable`\n\nConvert the provided macOS version to a comparable number. The special version\n'current' or '--current' will use `/usr/bin/sw_vers` to produce a value. Special\nnames are recognized from Leopard to Sequoia.\n\n## Licence\n\n[MIT](./LICENCE.md)\n\n## Change Log\n\n[CHANGELOG](./CHANGELOG.md)\n\n## Contributing\n\n- [Contributing](./CONTRIBUTING.md)\n- [Contributors](./CONTRIBUTORS.md)\n- [Code of Conduct](./CODE_OF_CONDUCT.md)\n\n[shell]: https://fishshell.com 'friendly interactive shell'\n[version]: https://img.shields.io/github/tag/halostatue/fish-utils-core.svg?label=Version\n[fisher]: https://github.com/jorgebucaran/fisher\n[fish]: https://github.com/fish-shell/fish-shell\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalostatue%2Ffish-utils-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalostatue%2Ffish-utils-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalostatue%2Ffish-utils-core/lists"}