* do not detect R for .Rprofile files, closes#2817
* get R package version, #5586
* update schema
* fix and simplify regex for rlang package version
* attempt to fix regex
* proper detect R packages, closes#5590
* reduce diff vs master branch
* fix: Change how starship version is determined
* Add STARSHIP_VERSION envar into CI for notarization
* More strict!
* Supress pushd/popd output
* Fix shellcheck issue with quoting
* Added hostname.detect_env_vars
based on the newly added context::detect_env_vars
- extended context::detect_env_vars to check for negated environment
variables as well, analogous to the other detect modules
- made hostname.detect_env_vars only active if ssh_only is set to false
for backwards compatibility
Co-authored-by: Dominik Sander <dsander@users.noreply.github.com>
* added clippy recommendations, removed unneeded comments
* Added new logic (suggested in https://github.com/starship/starship/pull/5196#issuecomment-1566228913)
The new `detect_env_vars` now requires either SSH_ONLY to be false or the
environment variable SSH_CONNECTION to be set, so that is will be used
* Fixed typo
* Refactored the detect_env_vars function for early returns and better readability
* Change boolean logic for better readability
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Apply suggestions from code review to `detect_env_vars` method.
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Fixed bracket error & updated comments
- fixed bracket error in hostname.rs, after changes
- updated comments for context.rs, for the suggested changes
* Removed obsolete warning from docs/config/README.md
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
---------
Co-authored-by: Dominik Sander <dsander@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(kubernetes): Add styling based on current context
Add an ability to customize the configuration of the kubernetes module style, based on the current context.
A new variable is added to the config section, called environments, which is a list of possible customizations. Each such customization is an object with a context_pattern regex, which matches context name, and an optional style and icon that will override the global configuration, if the currently used context matched the context_pattern.
Based on multiple attempts to add per-context styling and symbols to the kubernetes module.
- https://github.com/starship/starship/pull/1568 by @lht https://github.com/lht -> base
- https://github.com/starship/starship/pull/614 by @nomaed https://github.com/nomaed -> naming, symbol, some tests
Rebased and combined by @jankatins
Contains the following squasched commits
- Rename to contexts and move aliases into contexts
- Move deprecated functions to a submodule
- Cleanup: ignore None-valued KubeCtxComponents
- Add regex func + clean up matching-context search
- Placate paper clip
Closes: https://github.com/starship/starship/issues/570
Co-authored-by: =?UTF-8?q?Boris=20Aranovic=CC=8C?= <nomaed@gmail.com>
Co-authored-by: Jan Katins <jasc@gmx.net>
Co-authored-by: Kevin Song <chips@ksong.dev>
* refactor(kubernetes): Remove options and use clearer names
* test(kubernetes): Handle duplicated contexts right
* refactor(kubernetes): Cleaner user matching
* fix(kubernetes): Only show warning in case of problems
* feat(kubernetes): Add back alias replacements
* refactor(kubernetes): Cleanup rust usage
---------
Co-authored-by: Haitao Li <lihaitao@gmail.com>
Co-authored-by: =?UTF-8?q?Boris=20Aranovic=CC=8C?= <nomaed@gmail.com>
Co-authored-by: Kevin Song <chips@ksong.dev>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(fossil_metrics): add fossil_metrics module
* Return early if not in a Fossil check-out
* Add more tests for fossil_metrics
* Move is in Fossil checkout check after module enabled check
* Update type for new toml version
* Update the config file schema
* Rework parsing of fossil diff output
* Fix Fossil check-out detection in subdirectories
* Use regex to only match expected fossil diff output
* Use shared ancestor scanning and fix detection on Windows
* Add note on minimum Fossil version
* Updated nf-mdi-* to nf-md-* symbols
The following symbols where changed
- directory.read_only
- memory_usage
- meson
- nim
- os.symbols.Garuda
- os.symbols.HardenedBSD
- os.symbols.Illumos
- os.symbols.OpenBSD
- os.symbols.OracleLinux
- os.symbols.Redox
- os.symbols.Solus
- os.symbols.Windows
- package
- rlang
* Updated nf-mdi-* to nf-md-* symbols (for all other presets)
The following symbols where changed
for pastel-powerline:
- directory.substitutions.Documents
- nim
for tokyo-night
- directory.substitutions.Documents
- golang
* Updated nf-mdi-* to nf-md-* symbols for the default configuration in modules in src/configs/*.rs
The following symbols where changed
- azure
- battery.full_symbol
- battery.charging_symbol
- battery.discharging_symbol
- battery.unknown_symbol
- battery.empty_symbol
* Updated config-schema.json
* Updated src/modules/*.rs docs/config/README.md
and used `nerdfix` to check if I overlook anything
* Fixed the battery discharging symbol in the tests
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jtrv <travershasemail@gmail.com>
* From issue #4448, added `subscription_aliases`
as a field for the Azure module
Can be set in starship.toml with
[azure.subscription_aliases]
* Updated config file schema
* Added entry into documentation
* Update README.md
* Formatted with dprint
* feat(custom): add option to check if pwd is in a repo
* Apply suggestions from code review
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* change whenrepo to require_repo
* chore: fix doc formatting
---------
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
feat(aws): supports AWS_CREDENTIAL_EXPIRATION environment variable
Adds support for the AWS_CREDENTIAL_EXPIRATION environment variable
which was adopted as the standard way to set the expiration for
temporary credentials. The existing AWS_SESSION_EXPIRATION environment
variable is not dropped for backwards compatibility.
See https://github.com/aws/aws-cli/pull/7398
Handles starship.install (MSI installer) and starship.portable and makes starship an
empty meta-package that only depends on starship.install. MSI/installer packages
seem to be preferred over zip-based installers on chocolatey. Proper virtual packages
that allow choosing either a portable or install variant aren't implemented in chocolatey yet.
* feat: Pijul VCS support
* Extra bits needed for new module.
* Format Markdown table.
* Fix lint.
* Don't test Pijul module so thoroughly.
Installing from source is too expensive, and compiled binaries are only
available for Windows (and unofficially as well). Perhaps once Pijul
1.0.0 comes out of beta there will be more binaries available in package
repos.
* Format!
* Bad rebase, remove Pijul install from workflow.
* Mock Pijul commands for code coverage.
* Make fake .pijul directory in fixture.
* Truly mock `pijul` command.
* Rename module from `pijul` to `pijul_channel`.
* Format!
* Fix config-schema.json.
* Missed changing module name in docs/ folder.
* feat(hg_branch): Add support for mercurial topics and find hg root dir
* Fix clippy errors
* Use crate::utils::read_file
* Update config-schema.json
* Extend PathExt to retrieve device ID of Path
* Break hg root search when switching to another device
* Fix clippy and formatting errors
* Update docs/config/README.md
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update src/modules/utils/path.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update src/configs/hg_branch.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update hg_branch description
* Revert to lazy loading, use truncate_text from utils and use fake topic
* Format code and fix clippy error
* Revert to previous test string as topic is optional in the config
* Fix doc formatting
* Stub device_id for windows
* Update config-schema.json
* Update src/modules/hg_branch.rs
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Do not use unwrap in device_id
* Fix formatter error
* Use dev under non linux unixes
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Support `nix shell`
* Remove unnecessary `Debug` implementation
* Add test to detect false positive
* Improve detection of `/nix/store` in $PATH
* Add docs about unknown state
* Gate under `heuristic` flag
* Regenerate config schema
* Add Haxe support
* avoid unwrap
* fix doc formatting
* removed extra newline
* fixed formatter and linter issues
* fixed config file
* better version of detecting contents of .haxerc
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* removed openfl related defaults from detect_files
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* fixed formatting
* reworked reading .haxerc with fallback to haxe --version
* fixed formatting
* added fallback to executable for dev paths in .haxerc
* fixed linter issue
* added support for Windows paths
* use or_else
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* use shorter version with `?`
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* simplified regex check
removed check for "null" string
* fixed format
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(guix_shell): Initial implementation (#3999)
* fix(guix_shell): Change guix nerd font icon to water buffalo emoji
* fix(guix_shell): Added guix_shell entries in preset files
* fix(guix_shell): Moved guix_shell config docs in to the correct place (alphabetically)
* feat: Open Policy Agent module (#1740)
* Format documentation
* Fix typo, `ropa` -> `rego`
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* Update presets for OPA module
* Add extra space to OPA module symbol
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat(module): Add a meson devenv indicator
Adds a Meson Developer Environment indicator, if the MESON_DEVENV
variable is set. Inside a `meson devenv`, the prompt will include the
current Meson project name
This also contains a new Truncate utility function, which may be adapted for other modules in the future
* docs: Add Meson to presets
* docs(config): add color palette to docs
* feat: add user-defined color palette
* fix: update config schema
* refactor: apply suggestions from code review
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* fix: update new test
* feat: add support for multiple palettes
* docs(config): update docs for multiple color palettes
* docs(config): fix formatting
* test: test overriding a predefined color with itself
* docs: mention palettes cannot reference themselves
* refactor: warn when using a nonexistent palette
* test: test retrieving a nonexistent color palette
* fix: fix issues with palette log messages
* fix: update config schema
* fix: skip serializing palette if none
* refactor: change nonexistent palette message to warning
* fix: update config schema
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Have added configuration options to the k8s module to allow activating
the module only in directories that contains certain files or folders.
To ensure this is backwards compatible and because there are not really
any standard files or folders for Kubernetes I have set the defaults to
empty and will activate the module for all directories.
Have switched all vi/vim symbols to have the same prefix 'vim'. To
preserve backwards compatibility with existing configs I have added an
alias for the previous config name.
* add proper vi mode detection for fish shell
* update tests
* fix test
* update config-schema.json
* update docs
* add warning about symbols only supported in fish