Skip to content

Fix publish command #66

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 1 commit into from
Sep 15, 2023
Merged

Fix publish command #66

merged 1 commit into from
Sep 15, 2023

Conversation

kimkim0814
Copy link
Member

What

  • Qiita CLI の publish コマンドを実行すると別のファイルが生成される不具合の修正を行なった

How

  • 記事ファイルのidを書き換える前に、idを取得しようとする場合があるのでawaitを記事のidを変更する関数に指定した。

Why

  • Discussionsより問い合わせがあった内容の修正

再現手順

1. `npx qiita new newArticleBase` で新しいファイルを作る
2. `public/newArticleBase.md` を編集する
3. `npx qiita publish newArticleBase` で記事を投稿する
4. `public/newArticleBase.md` とは別に `public/{hashId}.md` が作られる

Refs

@kimkim0814 kimkim0814 requested review from a team and tomoasleep and removed request for a team September 13, 2023 10:13
Copy link
Member

@tomoasleep tomoasleep left a comment

Choose a reason for hiding this comment

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

🙆‍♀️

記事ファイルのidを書き換える前に、idを取得しようとする場合があるのでawaitを記事のidを変更する関数に指定した。

記事ファイルに id を書き込む前に、PostItem した結果をファイルに書き込むための、 id に対応した記事ファイルの探索 (

const localResult = await this.loadItemByItemId(item.id);
) が行われてしまい、記事ファイルが存在しなかったとして、新規にファイルが作られてしまうのだと理解した。

@ohakutsu ohakutsu changed the title Fix public command Fix publish command Sep 15, 2023
@ohakutsu ohakutsu merged commit 6fc357f into main Sep 15, 2023
@ohakutsu ohakutsu deleted the fix-public-command branch September 15, 2023 03:03
@ohakutsu ohakutsu mentioned this pull request Sep 19, 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.

3 participants