ankitpokhrel / ankitpokhrel/jira-cli

Using custom config path prints help text although keychain is setup

Offen
#652 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
need to check
Vorherrschende Sprache
Go
Sterne
6k
Forks
413
Ø Merge
2 T. 3 Std.
Gemergte PRs (30 T.)
1

Beschreibung

**Describe the bug**
When using a custom config path, `jira` will write the help text explaining how to retrieve a token although I have the token successfully setup in macOS keychain. It even then prints the output of the query after the help text.

```
jira issue --config ~/.config/.jira/TEST.yml list --plain --no-headers -a$(jira me) -s"In Progress" | head -3 | awk '{print $2}' | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}'

The tool needs a Jira API token to function.

For cloud server: you can generate the token using this link: https://id.atlassian.com/manage-profile/security/api-tokens
For local server: you can use the password you use to log in to Jira for basic auth or get a token from your Jira profile for PAT.

After generating the token, you can either:
- Export API token to your shell as a JIRA_API_TOKEN env variable
- Or, you can use a .netrc file to define required machine details

Once you are done with the above steps, run 'jira init' to generate the config if you haven't already.

For more details, see: https://github.com/ankitpokhrel/jira-cli#getting-started

TEST-115 TEST-111 TEST-94
```

when I rename `TEST.yml` to the default `.config.yml`

```
cd $HOME/.config/.jira
mv cp TEST.yml .config.yml
jira issue list --plain --no-headers -a$(jira me) -s"In Progress" | head -3 | awk '{print $2}' | awk -v d=" " '{s=(NR==1?s:s d)$0}END{print s}'
TEST-115 TEST-111 TEST-94
```

It works as expected

**Please provide following details**
1. JiraCLI Version:

```
(Version="1.4.0", GitCommit="eb842e18014303a575fde8e19508b3c7c13982c5", CommitDate="2023-05-09T07:09:45+00:00", GoVersion="go1.19.4", Compiler="gc", Platform="darwin/arm64")
```

2. Are you using Jira cloud or on-premise jira server?

```
Cloud
```

3. What operating system are you using? Also mention version.

```
macOSSonoma 14.0 Beta (23A5312d)
```

4. What terminal are you using? Also mention version.

```
alacritty --version
alacritty 0.12.2 (9d9982d)
fish --version
fish, version 3.6.1
```

**To Reproduce**

Steps to reproduce the behavior:
1. Have macOS
2. Configure jira with keychain
3. Create config
4. Move config to custom location
5. See error

**Expected behavior**
No error text when using custom location

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.