Skip to content

qiita.config.jsonを使って、設定を変更できるようにする #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 4, 2023

Conversation

getty104
Copy link
Member

@getty104 getty104 commented Jul 4, 2023

What

How

  • --configオプションを--credentialオプションに変更した
  • qiita initqiita.config.jsonを作成するようにした
  • qiita.config.jsonを用いて限定共有記事を取得するかどうかを選べるようにした(デフォルトはfalseにした)
  • --configオプションでqiita.config.jsonのパスを指定できるようにした

Why

  • 現在はリポジトリなどでも参照できる形で設定をかける場所がなかった。新たにqiita.config.jsonを使うことで、細かい設定を行えるようにした
  • 今までは--configを用いてローカルマシン上の認証情報を置く場所を指定できたが、configという名前がバッティングするので、元々--configとなっていたものを--credentialに変更した

Refs

#5

@getty104 getty104 requested a review from atm-snag2 July 4, 2023 02:44
@getty104 getty104 self-assigned this Jul 4, 2023
@getty104 getty104 requested a review from ohakutsu July 4, 2023 03:14
--config <config_dir>
qiita-cliの設定情報を配置するディレクトリを指定
--credential <credential_dir>
qiita-cliの認証情報を配置するディレクトリを指定
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits]

Suggested change
qiita-cliの認証情報を配置するディレクトリを指定
Qiita CLIの認証情報を配置するディレクトリを指定

includePrivate: false,
} as UserConfig;

if (fsSync.existsSync(this.userConfigFilePath as string)) {
Copy link
Member

@ohakutsu ohakutsu Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits & IMO]

Suggested change
if (fsSync.existsSync(this.userConfigFilePath as string)) {
if (fsSync.existsSync(this.getUserConfigFilePath())) {

ohakutsu
ohakutsu previously approved these changes Jul 4, 2023
Copy link
Member

@ohakutsu ohakutsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@getty104 getty104 force-pushed the add-include-private-command branch from d442ffa to ac94360 Compare July 4, 2023 08:03
@getty104 getty104 requested review from ohakutsu and removed request for atm-snag2 July 4, 2023 08:07
@getty104 getty104 force-pushed the add-include-private-command branch from ac94360 to 1cea071 Compare July 4, 2023 08:09
Copy link
Member

@ohakutsu ohakutsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@getty104 getty104 merged commit 8350590 into main Jul 4, 2023
@getty104 getty104 deleted the add-include-private-command branch July 4, 2023 08:10
@getty104 getty104 mentioned this pull request Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants