Skip to content

Commit

Permalink
feat: Set config file syntax in starship bug-report
Browse files Browse the repository at this point in the history
It seemed unintuitive that the syntax highlighting
for the config file was set to bash even when it was known
that it was in another language, such as powershell or lua.
  • Loading branch information
CLIDragon committed Jan 27, 2022
1 parent 865ae4f commit 9e34f9d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/bug_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ fn get_pkg_branch_tag() -> &'static str {
}

fn make_github_issue_link(environment: Environment) -> String {
let shell_syntax = match environment.shell_info.name.as_ref() {
"powershell" => "pwsh",
"fish" => "fish",
"cmd" => "lua",
// GitHub does not seem to support elvish syntax highlighting.
"elvish" => "bash",
_ => "bash",
};

let body = urlencoding::encode(&format!("#### Current Behavior
<!-- A clear and concise description of the behavior. -->
Expand All @@ -76,7 +85,7 @@ fn make_github_issue_link(environment: Environment) -> String {
- Build Time: {build_time}
#### Relevant Shell Configuration
```bash
```{shell_syntax}
{shell_config}
```
Expand All @@ -100,6 +109,7 @@ fn make_github_issue_link(environment: Environment) -> String {
rust_channel = shadow::RUST_CHANNEL,
build_rust_channel = shadow::BUILD_RUST_CHANNEL,
build_time = shadow::BUILD_TIME,
shell_syntax = shell_syntax,
))
.replace("%20", "+");

Expand Down

0 comments on commit 9e34f9d

Please sign in to comment.