1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-09-29 21:49:07 +00:00
Commit Graph

398 Commits

Author SHA1 Message Date
Thomas O'Donnell
cf8a6d0738
feat(python): Smarter python binary usage (#1947)
Update the python module to try multiple python binaries when
determining the version. With the new logic if starship doesn't find
`python` on the `PATH`, which is the default for some Linux Distros, it
will fallback to `python3` and then `python2`.
2020-11-30 13:14:18 -06:00
Dominik Nakamura
abfe4324e0
feat(rust): Support new rust-toolchain format (#1938)
* feat(rust): Support new rust-toolchain format

* Match file parsing with rustup and update link

* Use cargo to deserialize the rust-toolchain file

* Filter empty channel strings after extraction

* Use the option value instead of rewrapping
2020-11-30 13:52:55 +01:00
Zane Shelby
389e006c00
feat(java): Show Java module for Clojure projects (#966) 2020-11-30 13:50:56 +01:00
Gabriel de Perthuis
3dfe4ca932
fix(git_state): Handle gitdir indirection when rebasing (#1744)
* Make git_state more robust

No need to come up with fake progress info.

See #1374, #1761.

* git_state: add support for .git indirection when rebasing
2020-11-26 19:56:18 +01:00
David Knaack
0f483fad2b
perf(memory_usage): replace sysinfo with sys-info (#1886)
* perf(memory_usage): replace sysinfo with sys-info

* format

* simplify error handling
2020-11-23 21:17:15 -05:00
Sagittarius-a
688f1b3457
feat(git_branch): add remote branch name if different than local branch (#1915)
* feat(git_branch): add remote branch name if different than local branch

* feat(git_branch): Implement a more customizable remote branch

* feat(git_branch): Use more explicit API function name

* feat(git_branch): Remove forgotten draft documentation

* feat(git_branch): Set less verbose defaults

* feat(git_branch): Handle case to always display remote

* feat(git_branch): Fix error in rebase operation
2020-11-23 22:07:16 +01:00
David Knaack
cf297ff25d
fix: apply nightly clippy & fmt suggestions (#1922) 2020-11-23 20:38:11 +01:00
Aaron Gable
4b85b40cb0
feat(git_branch): add 'only_attached' config bool (#1910)
* feat(git_branch): add 'only_attached' config bool

This adds a new boolean, `only_attached`, to the configuration for
the `git_branch` module. This mirrors the `only_detached` config
value for the `git_commit` module: setting the value to true causes
the module to suppress its output when the user is not on a branch.

This allows users to have either a branch name or a commit hash in
their prompt, as opposed to having either a branch name or the
overly-wordy "HEAD (sha1)".

* Fix formatting
2020-11-23 19:22:51 +01:00
Masashi Aso
eb4e59d9ea
fix(swift): parsing swift version (#1913)
* fix parse swift version for swift-for-tensorflow

* add test for parsing swift version

Co-authored-by: Masashi Aso <maashi.apple.japan@icloud.com>
2020-11-20 19:34:27 +01:00
Adham
ac88301294
feat(terraform): Add hcl extension support to Terraform module (#1875)
* Add hcl file extension to terraform module

Signed-off-by: adhaamehab <adhaamehab.me@gmail.com>

* Update docs

Signed-off-by: adhaamehab <adhaamehab.me@gmail.com>
2020-11-14 18:33:21 +01:00
Jamie Kirkpatrick
3846070efa
fix(gcloud): respect overides of the active gcloud config (#1846) 2020-11-05 18:47:58 +01:00
Shu Kutsuzawa
c6d25a6a38
feat(lua): Add a Lua module (#1815)
* feat: add lua module

* docs: add lua module

* fix: lua version test

* feat: lua module can be detected if the current dir contains a "lua" dir

* feat: enable to use luajit

* fix: improve regex

* fix based on https://github.com/starship/starship/pull/1815#discussion_r510932742

* fix based on https://github.com/starship/starship/pull/1815#discussion_r511362581

* fix based on https://github.com/starship/starship/pull/1815#discussion_r510941252
2020-10-27 19:05:20 +01:00
Christoph Schlosser
89fc93d1f9
feat(cmake): Add CMakeCache.txt detection to CMake module (#1795)
* Add CMakeCache.txt to cmake module

* Remove trailing whitespace

* Apply fixes by @andytom

* Add CMakeCache.txt to docs

* Revert documentation for languages other than en
2020-10-25 19:10:42 +01:00
Mauricio Teixeira
eec961caaf
feat(openstack): Add module for OpenStack (#1664)
* first (crude) attempt to implement the openstack module

* Attempt to follow OpenStack standards for clouds.yaml location

* fmt

* provide unittest

* add documentation

* fix fmt

* fix clippy

* fix clippy

* fix fmt

* fix small nitpicks

* expand openstack explanation

* load config file using find_map

* fix fmt

* add test for valid config, plus fix test for invalid config

* fix fmt

* re-add forgotten comment
2020-10-24 11:46:43 +02:00
Miguel Ángel Melón Pérez
ea9f803018
feat(git_commit): add git tag to module (#950) 2020-10-23 11:49:19 -04:00
Thomas O'Donnell
c938eac1d6
fix(kubernetes): Parse stacked kubeconfigs (#1678)
Have refactored the kubernetes module to better support stacked
kubeconfigs. Rather than trying to grab both the current-context and
namespace on a single pass we now do two passes. These changes should
fix the problems where the current-context is defined in one file but
the context and the namespace are defined in a different file.
2020-10-23 13:39:50 +02:00
Thomas O'Donnell
c3cc6b174f
test(aws): Ignore tests that check .aws files (#1775)
When running the AWS module it will parse the AWS config found in
`~/.aws/config` to get the region. This means that tests that expect no
region to be set will fail if there exists a default profile with a
region set, which is probably true for most AWS users. To avoid this
have set the AWS tests that depend on the non-existance of a
`.aws/config` to be ignored.
2020-10-14 12:21:35 -04:00
David Knaack
205fd1abdd
fix(git_state): remove unwrap in describe_rebase (#1761) 2020-10-14 12:13:08 -04:00
SarthakSingh31
a73d7140eb
perf(git_status): Improved git_status module performance (#1777) 2020-10-14 12:12:41 -04:00
Matan Kushner
783eb3373d
fix: replace emoji for cmake and erlang (#1787) 2020-10-13 18:01:35 -04:00
David Knaack
4de9e43cff
fix(directory): preserve substitution order (#1782) 2020-10-13 15:06:41 -04:00
Tomer
a9f6d0f81e
fix(python): Read venv prompt from pyvenv.cfg (#1747)
*  Add  --prompt rendering to python virtualenv

* Use pyvenv.cfg to find prompt

* Remove usage of VIRTUAL_ENV_PROMPT variable

Seeing how both venv and virtualenv set a pyvenv.cfg, this isn't needed.
Additionally pyvenv.cfg is set in earlier versions than VIRTUAL_ENV_PROMPT,
which at this moment is in the unrelased python 3.10

* Smarter result unwrapping thanks to clippy
2020-10-08 09:58:00 +02:00
David Knaack
7c941af11a
feat(directory): strip Microsoft.PowerShell.Core\FileSystem:: prefix on windows (#1732) 2020-10-06 09:44:27 +02:00
Jeremy Hilliker
1673d565f4
feat(directory): add ellipsis to truncated paths (#1563)
Adds ellipsis in front of truncated paths: …/
Configurable through new config option: directory.truncation_symbol
Fixes #1162, #1626
2020-10-03 11:25:21 -05:00
Logan Magee
2693d125a8
fix: Pass --no-gpg-sign to git commit in tests (#1718)
Some users have commit.gpgSign set to true in their global git config,
causing tests which run `git commit` to fail if the configured
user.signingKey is not present (as is often the case with PGP smart
cards). Passing this flag overrides the global git configuration,
preventing git from attempting sign the specified commit. This change
has no effect on users who haven't set commit.gpgSign to true.
2020-10-03 12:22:19 +02:00
David Knaack
b633248606
fix(readonly): change module to match docs (#1728) 2020-10-02 13:10:46 -04:00
David Barnett
7241f4fbf7
test(git-state): tests failing when git init.defaultBranch set (#1692)
The tests for git-state assume the default branch is `master`.
In git 2.28 support for a global option, `init.defaultBranch`, to
change the default branch name which causes git-state tests to fail.
2020-10-01 19:08:31 +02:00
aspen
7c15b26ac9 fix: Fix compilation on iOS targets 2020-09-30 18:28:19 -04:00
Tilmann Meyer
2233683410
feat: add error messaging (#1576)
This creates a custom logger for the log crate which logs everything to a file (/tmp/starship/session_$STARSHIP_SESSION_KEY.log) and it logs everything above Warn to stderr, but only if the log file does not contain the line that should be logged resulting in an error or warning to be only logged at the first starship invocation after opening the shell.
2020-09-28 16:38:50 -04:00
Jan Katins
c93bd7b705
fix: actually disable per default disabled modules (#1677)
The default `disabled: true` is actually only available within the module (when the config struct is used and not the user toml) but not all (the hg_branch) modules checked it there again.

Document this in all places and add the check (+ test) to the hg_branch module.
2020-09-26 09:35:41 +02:00
Jan Katins
ffb1345052
feat(status): add the status module (#1651)
* add the exit code module

this allows to display more precisely the last command exit code
and to configure starship to not change the last charcter of the
prompt even in case of failure. It is disabled by default, because
it seems a bit redundant with the character module in its default
configuration.

* rename exit_code module to status

* Enforce a default disabled=true 

In the outer places, we only check for the disabled flag in the config toml file, only when this is loaded into the real config struct, we see the default. And if the default is true, we have to abort at that place. For status and hg_branch that wasn't so. I also commented the rest

* fix spaces in markdown table for status module

* Add a tip that status module is disabled by default

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>

* Remove unrelated changes for default disabled=true

Co-authored-by: Gaëtan Lehmann <gaetan.lehmann@gmail.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-09-26 00:04:51 +02:00
Tilmann Meyer
a245d54cdb
fix(git-state): Fix discrepancy between v0.44.0 and master (#1672) 2020-09-21 15:17:06 -04:00
Jan Katins
6426bbe3e4
feat: Add timings subcommand (#1629)
* feat: Add computational duration to all computed modules

This also means that in case we do some computations and these end up empty, we submit an empty module

* feat: Add timings subcommand

This outputs the timings of all computed modules, sorted by the duration it took to compute the module.

Useful for debugging why the prompt takes so long.

* feat: Add timings to explain output

* fix: Ensure that even empty custom modules get timings

* format main.rs

* feat: Only show interesting timings

* fix(tests): Change tests to look for empty string instead of None

* Use proper wording in timings help

* Revert "fix(tests): Change tests to look for empty string instead of None"

This reverts commit aca5bd1b03c48e1dee1b7ca91d66e2bda2d5a97c.

* fix(tests): Returning None in case the module produced an empty string

* fix: Ensure that linebreaks (and space) make a module not-empty

* Make cargo clippy happy

* Make Module.duration a proper Duration

* Only return a module if we would report it

* Change to cleaner way to return None for empty modules

* Avoid unnecessary module creation

* Simplify a string comparison

* Add timings to trace

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-09-21 19:06:15 +02:00
Thomas O'Donnell
bb324834a5
fix: restore the pyenv_prefix option to python (#1668)
Have restored the `pyenv_prefix` option to the python module. This is
added as a new variable that will only be shown if `pyenv` is being used
to determine the version of python that is being used.
2020-09-21 11:48:26 -04:00
Matan Kushner
d3100c5c82
fix: use suffixes for modules before directory (#1645)
Previously, all modules would have prefixes, which lead to the first
module having a dangling prefix. This change ensures that the first
few modules would instead have suffixes so that we don't start or
end with a prefix or suffix.
2020-09-08 12:09:21 -04:00
Dario Vladović
faba2d104d
fix(test): do NOT quote argument values for mocked invocations (#1527)
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-08-24 19:05:43 +02:00
Matan Kushner
1cd4f12bb4
Revert "fix: restore add_newline configuration (#1592)" (#1596) 2020-08-17 12:30:01 -04:00
Matan Kushner
1652c0bdb1
fix: restore add_newline configuration (#1592) 2020-08-16 23:33:40 -04:00
Tilmann Meyer
bcdf522af5
chore: remove unused name from Segment and remove some of the misleading underscores (#1584)
* chore: Remove unused name from Segment and remove some of the misleading underscores

* chore: Access members of `Segment` directly
2020-08-16 22:16:05 -04:00
Martin Åkesson
c0b6e97f57
fix(git_state): panic on interactive rebase (#1552) 2020-08-14 19:09:01 +02:00
David Knaack
0912ed0058
fix(test/dir): make lock thread-safe (#1575)
* fix(test/dir): make lock thread-safe

* stronger ordering
2020-08-14 18:58:53 +02:00
Marc Schreiber
8c71eb5307
feat: Add Undistract Me Feature (#1019)
Often it is handy to get notified when the execution of a command finished.
This commit includes notify-rust in order to generate a desktop notification
when a command execution finished.
2020-08-11 18:44:25 +02:00
Tilmann Meyer
88b603be38
test: introduce env variable mocking (#1490) 2020-08-07 15:13:12 -04:00
Daniel A. White
0be9ffc0a1
feat(shlvl): Add shlvl module (#1385)
* initial commit of support for shlvl

* documentation for shlvl

* use a symbol instead

* test coverage for shlvl

* actually disable when the config says to

* fix docs

* tweak defaults some

* refactor from pr comments

* redisable

* return early to avoid indenting

* make default suffix empty space

* fixing tests after suffix change

* updating docs for format

* making shlvl compatible with formatting

* adding variables table for shlvl

* removing extra line

* doc clarity
2020-08-05 18:30:01 +02:00
Stéphane Benoit
ef55042f2e
feat(perl): Added perl version module (#1382)
Adds a module for perl support.
2020-08-04 11:22:44 -05:00
Takahiro Tsuruda
c5f2eedf07
feat: Add gcloud module (#1493)
* feat(gcloud): Add document of gcloud module

Signed-off-by: dulltz <isrgnoe@gmail.com>

* feat(gcloud): Add gcloud module

Signed-off-by: dulltz <isrgnoe@gmail.com>

* feat(gcloud): Add test for gcloud module

Signed-off-by: dulltz <isrgnoe@gmail.com>

* Apply the comment

https://github.com/starship/starship/pull/1493\#discussion_r456965413
Signed-off-by: dulltz <isrgnoe@gmail.com>
2020-08-03 23:30:20 +02:00
David Knaack
36ae36282a
refactor(directory/lock): fix clippy, replace str with Path (#1544) 2020-08-02 18:42:38 +02:00
Steve Smith
b14be4dfb1
feat(package): Add Maven pom.xml version support (#1511)
* Add gitignore for Emacs backup files.

* Add package version support for Maven pom.xml.

* Update docs with Maven package version support.

* Fix for clippy.
2020-07-31 09:54:03 +02:00
Jason Wang
acefbc523f
feat(conda): add ignore_base option (#1539)
* Add ignore_base to conda module

* Add ignore_base to conda module in English docs

* `ignore_base` defaults to `true`
2020-07-30 18:57:15 +02:00
Alexey Chernyshov
fbaeef8589
Do not check readonly on network locations (#1506)
Do not try to analyze if the current process can write network location
on Windows. There's no way on Windows to tell if we can write a network
location because it's not being controlled by the OS itself. Thus now
the lock symbol is never shown on network locations.  

This PR introduces a new unsafe call.
2020-07-30 11:22:19 -05:00
Dario Vladović
997387ee50
refactor(java): parse version using regex (#1496)
* refactor(java): parse version using regex

Mock java version retrieval & extend java module test suite with
rendering tests.

* chore: remove nom crate

* fix(java): support parsing version from both stdout & stderr

* fix(java): fix java command mock

* refactor(java): simplify version regex
2020-07-29 18:26:46 +02:00
Dario Vladović
84f049f836
feat(dart): add Dart module (#1392) 2020-07-29 11:38:23 -04:00
Dario Vladović
feb4124cac
feat(swift): add Swift module (#1261) 2020-07-29 11:36:49 -04:00
Simão Mata
1acce65462
feat(package): Add support for Helm charts (#1525)
Signed-off-by: Simão Mata <sm@0io.eu>
2020-07-29 14:06:47 +02:00
Dario Vladović
6763a7b006
test: fix mocked commands (#1491)
Ensure that output of mocked commands faithfully replicates output
of actual commands including any trailing whitespace.
2020-07-19 17:01:53 -04:00
Batuhan Apaydın
03d75eb419
feat(helm): Add Helm module (#1463)
Signed-off-by: Furkan <furkan.turkal@hotmail.com>

Co-authored-by: Furkan <furkan.turkal@hotmail.com>
2020-07-17 09:51:25 +02:00
Thomas O'Donnell
15bc9fa210
fix(ocaml): Stop new line being included in ocaml version (#1479)
This fixes a regression in the ocaml module that caused the excess whitespace
to not be trimmed from the version.
2020-07-15 23:22:40 +02:00
Alexey Chernyshov
08b74c1672
fix(git_status): Fix file rename inconsistency compared to git (#1411)
* Remove renames_index_to_workdir() option from git status

This option causes advanced files rename detection which causes inconsistency between `git status` and Starship reports.
Closes #1371

* add test for manually remaned and deleted files in git_state module

* fix tests
2020-07-14 23:08:56 +02:00
Alexey Chernyshov
57c39437bc
feat(directory): Show lock symbol if current directory is read only (#1298)
Add feature to display icon if current directory is read-only.
2020-07-13 16:55:42 -05:00
Gerry
427f48aa8d
fix(nodejs): remove line break from version (#1464)
A recent refactor of modules to use format strings accidentally got rid
of the `trim()` on the NodeJS version string. This just adds it back so
that the prompt doesn't include an unnecessary line break when showing
that module.
2020-07-10 11:41:25 -04:00
Tilmann Meyer
bd68970fab
feat(cmake): Add CMake module (#1456)
* feat: CMake module

* docs: Document symbol variable
2020-07-09 21:40:33 +02:00
Tilmann Meyer
7edd0f6218
test(terraform): move tests which do not require env vars (#1455)
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-07-08 20:24:38 -04:00
Zhenhui Xie
ec76fafff0
feat: refactor modules to use format strings (#1374) 2020-07-07 18:45:32 -04:00
Matan Kushner
428a78ebb5
fix!: remove haskell module (#1418)
Given how slow the Haskell module is (#1240), it is slowing down the entire prompt
from rendering when the module is active. This commit removes the module until we
can find a faster way to retreive the Haskell version.
2020-07-06 13:00:52 -04:00
Dario Vladović
ec0b577204
fix(ocaml): trim OCaml verison (#1436) 2020-07-05 21:51:04 -04:00
Thomas Haessle
021d82a224
fix: manage sandboxed version of OCaml (#1433)
* fix: manage sandboxed version of OCaml

* fmt: apply cargo fmt

Co-authored-by: Thomas Haesslé <thaessle@cutii.io>
2020-07-05 13:20:11 -04:00
Thomas O'Donnell
6e289721d4
fix(custom): Fix fallback shell not working on macOS (#1402)
Have switched the fallback shell used when the custom module can't use
the default to use `/usr/bin/env sh` rather than `/bin/env` since
`/usr/bin/env` is more commonly available.
2020-06-28 15:41:05 -04:00
Thomas O'Donnell
affae806fb
refactor(custom): Add additional logging to the custom module (#1389) 2020-06-26 11:30:11 -04:00
dependabot-preview[bot]
f9bf2324e2
build(deps): bump path-slash from 0.1.1 to 0.1.2 (#1377)
* build(deps): bump path-slash from 0.1.1 to 0.1.2

Bumps [path-slash](https://github.com/rhysd/path-slash) from 0.1.1 to 0.1.2.
- [Release notes](https://github.com/rhysd/path-slash/releases)
- [Changelog](https://github.com/rhysd/path-slash/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rhysd/path-slash/compare/0.1.1...v0.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Fix tests to improve slash handling on Windows

* Fix number of slashes

* Try fixing the slashes again

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Matan Kushner <hello@matchai.dev>
2020-06-22 18:41:05 -04:00
Dario Vladović
d1bbba321b
test(nodejs): add test attribute to omitted tests (#1367) 2020-06-21 17:59:00 +02:00
Dario Vladović
b176fc35ac
feat(nodejs): support additional file patterns (#1311) 2020-06-21 10:33:58 +02:00
Daniel A. White
b238574100
feat(dotnet): adds additional files to detect .net projects (#1303)
* adds additional files to detect .net projects

* test .net output with a regex pattern
2020-06-21 10:22:20 +02:00
Julian Gehring
d21cb62e3a
Replace dirs with dirs-next dependency (#1361)
`dirs` will be unmaintained for the foreseeable future, so
switch to the maintained fork `dirs-next`.

Closes #1319.
2020-06-20 12:59:35 -05:00
SeongChan Lee
611a754ec7
fix(directory): Fix path contractions for symlinked git repos (#1299)
Fixes git repo path contractions in two situations:

1. When path obtained from `PWD` is a logical path but git libraries
   return physical paths.
2. When a git repository's subdirectory is symlinked to ouside of the
   repository tree.

(1) is fixed by implementing a realpath()-like function, then reparsing
the (possibly logical) `PWD` using realpath() to convert logical
components into physical ones. The physical paths are then matched
against each other.

In the case of (2), the default behavior has been changed by simply
contracting to the home directory, exactly the same as if we are not in
a repo at all. Because determining the correct contraction is not
obvious, we bail out and just pretend we are not in a repo at all.
2020-06-17 22:44:51 -05:00
Thomas O'Donnell
055986e2b1
feat(python): Add option to change the python binary (#1297)
* Add option to change the python binary

We are going to start to have problems with the python binary as python2
is removed and replaced with python3. To make the transition easier I
have added an option to the python module to allow the user to pick a
particular binary, e.g `python3`, for the module to use when selecting
the version of python. I have also refactored the python tests moving
almost all of them into the module and removing the dependency on the
version of python that is installed on the system.

* Add advanced config section to python module docs

Have added an advanced config section to the python module docs and
moved the `python_binary` option into that section.
2020-06-14 11:27:10 +02:00
Thomas O'Donnell
c182572796
Fix PHP version including error messages (#1317)
PHP will output error messages when displaying the version if, for
example, there is something wrong with the local `php.ini` file. Have
updated the command used to get the PHP version to only use the default
PHP config.
2020-06-13 01:04:53 +02:00
Rekihyt
fcd003785b
feat(nim): Add Nim module (#1189)
* Nim module and tests

* Add nim to docs

* parse_nim_version refactor, add nim desc

* Add nim symbol to Nerd Font preset

* Yellow with v prefix as default version

* Nim version fmt fix

* Update docs/config/README.md

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Update src/modules/nim.rs

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Nim module and tests

* Add nim to docs

* Yellow with v prefix as default version

* Update docs/config/README.md

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Update src/modules/nim.rs

Co-authored-by: Dario Vladović <d.vladimyr@gmail.com>

* Add nim to docs, proper version formatting.

* Remove v from symbol, add to fmt string

* cargo fmt

Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
2020-06-09 19:14:47 +02:00
Samuele Esposito
fe2b3d491e
feat(time): Show module with time range (#992)
* Creation of range field in TimeConfig

* time_range parsing

* Hide time module if outside of time_range

* Tidying of code, and properly handling more cases

* is_inside_time_range function

* Tests and fmt

* Update docs

* The configuration needs the 24-hours format

* Fix clippy errors
2020-05-31 19:43:08 +02:00
Radu Butoi
ab1c3d1c54
feat(directory): Add directory substitutions (#1183)
Adds an option to provide a table of strings to substitute in the
directory string. Fixes #1065.

Co-authored-by: Radu Butoi <butoi@google.com>
2020-05-31 19:32:35 +02:00
Grégoire Geis
09996159f4
fix(custom): improve handling of Powershell prompts (#1237)
To improve overall support of PowerShell in custom modules,
the ability to pass arguments to the shell was also added. Additionally,
the arguments `-NoProfile -Command -` will be automatically passed
to PowerShell, unless other arguments are given by the user.
2020-05-27 09:38:05 +02:00
nobv
63799b97d1
feat(PureScript): Add Purescript module (#1227)
* Added configs/purescript

* Added modules/purescript

* Added necessary codes

* Added tests

* Updated README

* Fixed color because black is hard to see

* Fixed of push mistake

* Fixed pointed out in PR
2020-05-22 18:26:58 +02:00
Dario Vladović
c008f4041b
feat: add Zig module (#1231) 2020-05-21 18:49:49 +02:00
Hirochika Matsumoto
9e8f35d746
feat(ocaml): Add OCaml module (#1218)
* Add OCaml module

* Update README.md accordingly

* Fix typo

* Add Reason support

Obtain OCaml version using `-vnum` flag.
Extend conditions to match projects using jbuild, esy
or merlin.

* Update README.md

Co-authored-by: Dario Vladovic <d.vladimyr@gmail.com>
2020-05-21 18:43:13 +02:00
Jean Gautier
02edad0c66
fix(directory): avoid confusing modules with PowerShell paths (#1114)
* Avoid confusing modules with PowerShell paths

* Avoid confusing modules with PowerShell paths

Powershell supports PSDrives (https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-psdrive?view=powershell-7) that allow to create "logical" drives mapped to actual Windows drives.

* Preserve Windows directories

* Preserve logical paths for Powershell

* Fix formating with cargo fmt

* Fix directory_in_root test

Co-authored-by: Jean Gautier <jean.gautier@ssi.gouv.fr>
2020-04-30 10:40:56 +02:00
Karol Fuksiewicz
eba4d87612
feat(package): configurable displaying package version for packages marked as private (#1109)
* feat(package): config for enabling package version in private packages

* test(package): refactor package tests
2020-04-28 10:53:30 +02:00
Oisín
8e8519552f
fix(haskell): avoid creating .lock files or downloading GHC (#1147)
* (Haskell) avoid creating .lock files or downloading GHC

* Fix stack command in mock expectations for Haskell module + befriend cargo fmt
2020-04-28 10:07:18 +02:00
Benedikt Reinartz
8c17f7b97c
feat(erlang): Add Erlang module (#1129) 2020-04-27 12:09:42 +02:00
Alexandru Macovei
decd4e2a5d
fix(haskell): add description for haskell, used by the explain command (#1141) 2020-04-25 14:34:01 +02:00
Alexandru Macovei
2c30f4bd9e
fix(crystal): Add Crystal module to default prompt order (#1140) 2020-04-24 19:37:34 +02:00
Thomas O'Donnell
060689fa88
fix: Fix latest clippy suggestions (#1136)
Have removed some imports that Clippy says are not needed anymore.
2020-04-24 12:37:13 +02:00
Alex Jurkiewicz
965338df95
feat(python): Add scan_for_pyfiles option (#692)
Also adds two new entries to the list of hardcoded files to check:
setup.py and __init__.py.
2020-04-14 10:26:51 +02:00
Thomas O'Donnell
beed0acc6c
fix(python): Fix venv name not showing when using pyenv (#1046)
This fixes an issue where the name of the virtual environment is not
being shown when using the `pyenv_version_name` setting.
2020-04-14 10:23:57 +02:00
Thomas O'Donnell
391add767f
revert: fix(git_branch,git_status): implement fallback branch_n… (#1092)
This reverts commit 8d90baf0eb.
2020-04-11 16:10:39 -04:00
Grégoire Geis
15dc486e72
Add support for custom modules. (#916) 2020-04-11 18:37:24 +02:00
Jonathan Knapp
19e8301ff1
Fix ruby version to not assume length (#1082) 2020-04-10 18:41:14 +02:00
Udo Kramer
d27b263023
feat(package): Add project version for Elixir (#1067) 2020-04-08 18:39:54 +02:00
Bernardo Meurer
7718450311
feat(nix_shell): add symbol to nix-shell module (#1058)
* feat: add nix-shell icon

Fixes #1048

* style: make nix-shell bold blue by default

It better matches the whole theme around Nix and snowflakes.
2020-04-07 18:35:18 +02:00
Hendrik Rombach
8d90baf0eb
fix: implement fallback branch_name for bare git repos (#1035)
closes #686
2020-04-07 12:01:40 +02:00
Shu Kutsuzawa
2f449af680
Fix julia icon based on https://julialang.org/community/standards/ (#1055)
According by this standards
> While "Julia" is a female name in many parts of the world, the programming language is not a person and does not have a gender.
2020-04-07 11:07:51 +02:00
Kevin Pullin
9924af55db
feat(aws): Use AWS_VAULT as the profile if set (#984)
* Use AWS_VAULT as the profile if set

[aws-vault](https://github.com/99designs/aws-vault) sets
the `AWS_VAULT` env var instead of `AWS_PROFILE` when an
aws-vault session is active.

This PR adds support for reading the AWS profile value from
the `AWS_VAULT` env var, giving priority to `AWS_VAULT` if both
it and `AWS_PROFILE` are set.

* Update docs for AWS_VAULT
2020-04-06 16:59:56 +02:00
Barnaby Keene
b685bb2954
feat: add docker context module (#996)
* feat: add docker context module

Adds a simple module that checks for a Docker config file and if present, reads the `currentContext` value out and displays on the prompt with a whale.

* feat: add `only_with_compose_yml` option to docker_context

When enabled, will only show the docker context name if there's a docker-compose.yml file in the current directory.

* Update src/modules/docker_context.rs

Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>

* Update src/modules/docker_context.rs

Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>

* rename `only_with_compose_yml` configuration key to a more generic `only_with_files`

* Update src/modules/docker_context.rs

Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>

* re-order configuration table

* Update docs/config/README.md

Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>

* Update src/configs/docker_context.rs

Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-04-05 21:42:55 +02:00
Shu Kutsuzawa
bd016b6ce2
feat: Enable to display language version when .<lang>-version file exists. (#1028)
* adjust https://github.com/sonnym/elmenv

* adjust https://github.com/syndbg/goenv

* adjust https://github.com/jenv/jenv

* adjust https://github.com/nodenv/nodenv

* adjust https://github.com/phpenv/phpenv

* adjust https://github.com/rbenv/rbenv

* add description

* golang.rs is executed rustfmt

* add testcases
2020-04-03 21:02:28 +02:00
sk1985
e38be5073f
feat(kubernetes): context aliases (#1015)
* Allow kubernetes module to use aliases for contexts

* documentation for kubernetes context aliasing

* Apply suggestions from code review: consistent ordering of options in documentation

Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-04-03 20:18:44 +02:00
Shu Kutsuzawa
dba3467dee
feat: Add a julia module (#1030)
* add a julia module

* Update docs/config/README.md

Co-Authored-By: Thomas O'Donnell <andytom@users.noreply.github.com>

* fix based on https://github.com/starship/starship/pull/1030#pullrequestreview-381767326

Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
2020-04-03 20:16:34 +02:00
Shu Kutsuzawa
edcec7eed8
feat(package): Add project version for julia (#1036)
* add project version (for julia) to package module

* update docs
2020-04-03 20:16:22 +02:00
David Knaack
55503bb77b
perf(dotnet): fail faster in the dotnet module (#1034) 2020-04-03 12:34:35 -04:00
David Knaack
56d475578e
fix: possible fix for Intermittent Test Failures in GH Actions (#987)
* fix: possible fix for Intermittent Test Failures in GH Actions

* undo some of the chnages to directory.rs

* typo

* add docs
2020-03-15 12:12:25 -05:00
Thomas O'Donnell
f790b67e3d
refactor: Fix new Clippy suggestions (#1006)
* Fix new Clippy suggestions

This just cleans up a few new suggestions from Clippy.

* Dummy commit to trigger CI
2020-03-14 11:37:51 -04:00
Matan Kushner
d0e1904758
feat(package): ignore private JS packages (#975)
`private: true` in `package.json` files means that the package is not supposed to be published to npm, which makes the `version` field meaningless, so we should probably ignore it to not clutter the prompt too much.
2020-03-05 10:49:11 -05:00
KokaKiwi
243e97cfe6
feat: add Elixir module (#437) 2020-03-01 22:29:27 -05:00
Tadej Novak
7e66791cb2
feat: add singularity module (#932) 2020-02-26 11:18:19 -05:00
Kevin Lane
ce540fff7a
feat: display Gradle project version (#662)
This PR adds package version support for Gradle projects. The version number is extracted from the `build.gradle` file in the current directory, similar to existing support for other packages.
2020-02-21 14:12:21 -05:00
Thomas O'Donnell
d44c037ba5
test: refactor ruby and php modules to use mocked commands (#936) 2020-02-21 11:52:39 -05:00
Onielfa
ddd8cfb388
perf: refactor git status to use HashMap for counts (#938) 2020-02-14 20:38:25 -05:00
nesmyslny
0312c7b91e
feat(git_commit): Show the hash of commits when detached HEAD (#738) 2020-02-12 14:56:29 -05:00
Thomas O'Donnell
67397d9096
test(golang): refactor golang tests to use mocked command (#925)
Refactor the golang module tests to use a mocked command and no
longer depend on having a particular version of Go installed.
2020-02-12 13:22:21 -05:00
Brett Mandler
bc600e4321
feat: Add cabal and hpack detection for the haskell module (#915) 2020-02-06 19:29:57 -05:00
Andrew Prokhorenkov
cead23edca
test: port Haskell module tests to integration test (#913) 2020-02-06 12:12:07 -05:00
Andrew Prokhorenkov
273a937505 feat: Add an Elm module (#879)
Former-commit-id: d42137309da457a438b554601f0734db963a193e
2020-02-05 22:57:04 -05:00
Youssef Habri
f665df226c
feat: Add Crystal version module (#170) 2020-02-04 18:27:06 -05:00
Sam Rose
83337a1a03
perf: Optimize files, folder and extension lookups in Context (#880) 2020-02-03 16:57:48 -05:00
Matan Kushner
3365beae09 test(nodejs): Port nodejs module tests from E2E to integraton (#867)
Replaces the existing nodejs module end-to-end tests with integration tests that don't require preinstalled environmental dependencies.

- Moved the tests to the same file as the module they test
- Created a render_module utility function for rendering modules within tests
- Removed Node.js installation during CI setup
- Add Shell to Context to allow for tests to not run shell-specific code
2020-01-26 16:37:18 -06:00
Andrew Prokhorenkov
6f2c9fb397 feat: add Haskell Stack support (#546)
Add a Haskell Stack module when a stack.yaml file is detected
2020-01-25 00:48:39 -06:00
Sam Rose
f4c095de92 fix(java): Add detection for *.gradle files (#871)
Currently the Java module detection looks for build.gradle specifically, but it's possible to rename build.gradle to *.gradle. This change adds Gradle files to the list of detected file extensions.
2020-01-24 10:22:30 -05:00
Peter Bull
b723a7d562 fix(python): Trim "Anaconda, Inc." from version (#861) 2020-01-21 11:14:40 -05:00
Thomas O'Donnell
197376633a fix: Fix incorrect prefix usage in cmd_duration module (#832)
Fixed the way the cmd_duration module is setting it's prefix to be the
same as the other modules.
2020-01-18 01:15:08 -06:00
Thomas O'Donnell
0fe90bf018 refactor(dotnet): Use exec_cmd util (#826)
Have refactored the dotnet module to use the util::exec_cmd rather than
the Command module directly.
2020-01-15 13:52:38 -05:00
Thomas O'Donnell
60ce320912 refactor(php): Use exec_cmd util(#825) 2020-01-12 17:50:25 -05:00
Hendrik Rombach
dab27f3334 fix: Correct module description text for git_commit (#812) 2020-01-07 12:12:40 -05:00
David Hewson
178f177dac perf(hg_branch): Replace direct calls to hg (#803)
perf: don't use hg process to get branch / bookmark information, each call was taking 250ms and it was making on average 2 calls.
the branch and bookmark information is available in files in the root of the repo, use that instead.
now takes 300 micro seconds

fix: do not use .hgignore to decide if it is an hg repo. was providing false positives. #721

fix: after changing branch the new branch was not show (the old branch was shown), the new branch is now correctly shown. #722

fix: if no branch override was set it would say (no branch) however if you commited in that state you would commit to the branch default so say that instead
2020-01-03 17:51:45 -05:00
Jon Grythe Stødle
8e5fa60fc8 feat: Add the starship explain command (#699)
This adds the explain argument to Starship, which explains what the printed modules in the prompt are.
2020-01-01 23:19:08 -05:00
marblenix
b82ff321fa feat(git_status): Add a stash count segment (#598) 2019-12-28 22:20:36 -05:00
Tobias Bieniek
ecc8754335 fix(package): Use specified directory instead of current working directory (#774) 2019-12-23 22:38:00 -05:00
Matan Kushner
8cf4ce21d9
perf: Dereference before to_string in aws module 2019-12-20 12:58:59 -05:00
Mike Sampson
256a2be949 feat: Implement AWS region aliases (#646) 2019-12-20 12:30:47 -05:00
Luca Rinaldi
6a2b0a67b0 feat: cmd_duration module optionally reports milliseconds (#696) 2019-12-19 17:38:06 -05:00
Mario Arias
aab35674d2 feat: Adds build.gradle.kts detection to the Java module (#731) 2019-12-19 10:17:50 -05:00
David Knaack
6724ce5bb5 fix(powershell): % sign was prefixed with ` (#730) 2019-12-13 14:55:20 -05:00
dependabot-preview[bot]
d71373b265 build(deps): bump sysinfo from 0.9.6 to 0.10.2 (#711) 2019-12-12 15:32:46 -05:00
Morten Scheel
e38a257656 feat: add composer.json version to Package module (#716) 2019-12-11 21:05:39 -05:00
AppleTheGolden
3c835ba34b fix: Truncate long paths in conda environment names (#694)
Environment names created via conda create -p [path] tend to be too long for comfort, so this truncates them.
2019-12-09 12:59:02 -05:00
wdullaer
44b37a7bac feat: Implement terraform module with workspace and version (#644) 2019-12-08 20:42:51 -05:00
Dan Wendorf
dee25c7b35 feat: Add prefix config to directory module (#642) 2019-12-06 14:19:11 -05:00
Qingping Hou
c5a206e3cf feat: Add git_commit module (#673) 2019-12-06 11:57:42 -05:00
Stephen Ball
46904e5045 feat: Add PHP version module (#244) 2019-12-05 13:04:27 -05:00
Luca Rinaldi
1558b22bb0 fix: multiple batteries support in the battery module (#669)
Closes #656
2019-12-03 11:48:50 -05:00
Thomas O'Donnell
edc62f4518 refactor: Refactor modules to use the exec_cmd util (#676)
Have refactored the golang, java, nodejs, python, ruby and username
modules to use the new `exec_cmd` util.
2019-12-02 17:42:55 -05:00
Luca Greco
337f213753 feat: Add the hg_branch module (#569) 2019-12-02 17:37:18 -05:00
Raidou
2a75a18eb1 fix: Fix panic when using fish-style pwd with unicode symbols (#672) 2019-11-29 00:02:22 -05:00
Thomas O'Donnell
45d977aa39 fix: Remove duplicated "v" in package versions (#648) 2019-11-20 09:16:07 -05:00