1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-29 04:53:29 +00:00
Commit Graph

22 Commits

Author SHA1 Message Date
Barnaby Keene
2c7e01cd62 refactor: improve as-a-library usage by removing ArgMatches depe… (#547)
This removes ArgMatches from the Context struct and replaces it with a simple HashMap. This work is towards getting Starship in a better place for use as a library in other shells written in Rust so they don't need to use a command-line interface to invoke and configure things.

Contributes to #521
2019-10-20 17:26:27 +09:00
Zhenhui Xie
bc9e44f45c fix: Add disable configuration option to kubernetes module (#491) 2019-10-05 23:10:16 +09:00
Matan Kushner
05210b9510
refactor: Go from Rust workspaces to a package with nested packages (#480) 2019-10-04 22:30:46 +09:00
Zhenhui Xie
dd0b1a1aa2 refactor: Refactoring config (#383)
This PR refactors config and puts configuration files for all modules in `configs/`.
2019-09-30 21:10:35 +09:00
Nick Young
7e891f17c1 perf: Lazy load files from directory (#335)
Changes context to use `once_cell` to lazily evaluate directory listing on first use.
2019-09-14 09:23:53 -05:00
Neil Kistner
9f70ffb7a7 fix: Lazy load git repo and only run module if not disabled (#306)
A couple of optimizations are done in this PR. One, we now will check config ahead of time to see if a module is disabled before running any module code. Also, we won't try to discover a git repository unless the module requests access to it.
2019-09-09 19:14:38 -04:00
Gabriel de Perthuis
69ebab46a4 fix: Don't trigger an extension match on hidden files (#299)
Addresses #52, closes #280.
2019-09-07 11:05:25 -04:00
Saghm Rossi
dfe2ae643a fix a few typos (#178) 2019-08-17 20:50:42 -07:00
Matan Kushner
f40f73dc8e fix: Address longstanding linter errors 2019-08-05 11:05:08 -04:00
Matan Kushner
0bc28c521d
feat: Add configuration for add_newline (#116)
- Replace TableExt with a Config trait that extends toml::value::Table
Add configuration for add_newline
- add_newline is a root-level configuration value. When set to false, the initial newline before the prompt is removed.
2019-07-27 18:25:13 -04:00
Matan Kushner
feb6d8aec7 refactor: Better document context contents 2019-07-19 18:45:38 -04:00
Matan Kushner
0703a74048
ci: Add GitHub releases to CI (#95) 2019-07-14 17:54:45 -04:00
Matan Kushner
463ec26024
feat: Add a disabled configuration option for modules (#86)
• Add support for the disabled configuration option
This will allow you to selectively disable modules that you don't want or need. 😄
• Overwrite starship configuration file path with STARSHIP_CONFIG environment variable
• Write tests for the two configuration options that are available
2019-07-02 16:12:53 -04:00
Matan Kushner
097f1b05f1
Add support for prompt configuration (#62)
- Create `Config` struct that is added to `Context` when initialized
- Read `~/.confg/starship.toml` during initialization (can be updated later to also look at `$XDG_CONFIG_HOME`)
- `Context` now has a method for creating modules. This allows us to provide modules with a reference to the configuration specific to that module
2019-06-10 15:56:17 +01:00
Matan Kushner
8239fbd12b
Refactor integration tests (#71)
- Create subcommands to be able to print modules independently
	- `starship prompt` will print the full prompt
	- `starship module <MODULE_NAME>` will print a specific module
		e.g. `starship module python`
	- Added `--path` flag to print the prompt or modules without being in a specific directory
	- Added `--status` flag to provide the status of the last command, instead of requiring it as an argument
- Refactored integration tests to be end-to-end tests, since there was no way in integration tests to set the environment variables for a specific command, which was required for the `username` module
- Moved e2e tests to `tests/testsuite` to allow for a single binary to be built
	- Tests will build/run faster
	- No more false positives for unused functions
- Added tests for `username`
- Removed codecov + tarpaulin 😢
2019-06-06 13:18:00 +01:00
Tim Mulqueen
4d034351e8 fix: Don't check extensions of directories (#64)
* now checks for type of path when doing scan
* added unit test to cover failure case
2019-05-22 12:04:51 -04:00
Matan Kushner
90d6e6cf0b
Implement the git status module (#45) 2019-05-13 22:43:11 -06:00
Tim Mulqueen
5fd715e7c3 Implement directory scanner (#34) 2019-05-12 13:37:23 -04:00
Matan Kushner
8b5055d510
Parallelize prompt modules (#46) 2019-05-09 23:51:50 -04:00
Matan Kushner
9a352c0acc
Add the Git branch segment (#32)
Added
- Repository to Context for reuse in directory and git_branch
- git_branch to prompt

Changed
- Made segments bold to match spaceship
2019-04-26 22:07:07 -04:00
Matan Kushner
bb2bcd604b
Share dir_files between segments through Context (#16) 2019-04-23 14:51:08 -04:00
Matan Kushner
022e0002e4
Use "context" to contain run details (#14)
* Create "context" to contain run details

* Use context in tests and benchmarks
2019-04-19 16:57:14 -04:00