Skip to content

Check if local files are up to date #37

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 3 commits into from
Jul 26, 2023
Merged

Conversation

ohakutsu
Copy link
Member

@ohakutsu ohakutsu commented Jul 21, 2023

What

現在、Qiita上で記事を変更した場合にpull --forceをしなければ、ローカルの記事ファイルが古い状態になってしまう可能性がある。
→ Qiita上で変更したものが上書きされてしまい消えてしまう恐れがある。

そのため、Qiita上で記事が更新されているが、記事ファイルが古い状態になってしまっているときに注意を出すようにした。

How

Why

Refs

@ohakutsu ohakutsu self-assigned this Jul 21, 2023
@ohakutsu ohakutsu requested review from a team and getty104 and removed request for a team July 21, 2023 02:26
@@ -17,9 +17,9 @@ export const pull = async (argv: string[]) => {

const qiitaApi = await getQiitaApiInstance();
const fileSystemRepo = await getFileSystemRepo();
const isLocalUpdate = args["--force"];
const forceUpdate = args["--force"];
Copy link
Member

Choose a reason for hiding this comment

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

pull.tssync-article-from-qiita.tsの変数の命名変更は別文脈なのでコミット分けたいです 🙏

@getty104
Copy link
Member

@ohakutsu エラーが出ている時のUIの画像を添付して欲しいです 🙏

@ohakutsu
Copy link
Member Author

ohakutsu commented Jul 21, 2023

Screenshots

Qiita Preview

image image

CLI

image

@ohakutsu ohakutsu force-pushed the check-local-files-are-up-to-date branch from 7439b9b to 5b39357 Compare July 21, 2023 06:51
@ohakutsu ohakutsu requested a review from getty104 July 21, 2023 06:52
getty104
getty104 previously approved these changes Jul 21, 2023
Copy link
Member

@getty104 getty104 left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines 272 to 277
private async syncItem(
item: Item,
beforeSync: boolean = false,
isLocalUpdate: boolean = false
forceUpdate: boolean = false
) {
const fileContent = FileContent.fromItem(item);
Copy link
Member

Choose a reason for hiding this comment

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

LGTMした後ですみません
テストは変更ないですが大丈夫ですか?

@ohakutsu ohakutsu force-pushed the check-local-files-are-up-to-date branch from 5b39357 to c800d90 Compare July 25, 2023 02:49
@ohakutsu ohakutsu requested a review from getty104 July 25, 2023 02:50
Copy link
Member

@getty104 getty104 left a comment

Choose a reason for hiding this comment

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

LGTM!

@ohakutsu ohakutsu merged commit af83aef into main Jul 26, 2023
@ohakutsu ohakutsu deleted the check-local-files-are-up-to-date branch July 26, 2023 02:22
@ohakutsu ohakutsu mentioned this pull request Jul 28, 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