Skip to content

Commit 4391454

Browse files
author
ikepu-tp
committed
change: draft to ignorePublish
1 parent bf4a782 commit 4391454

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

src/commands/publish.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const publish = async (argv: string[]) => {
2626
let targetItems: QiitaItem[];
2727
if (args["--all"]) {
2828
targetItems = (await fileSystemRepo.loadItems()).filter((item) => {
29-
if (item.draft === false) return false;
29+
if (item.ignorePublish === false) return false;
3030
return item.modified || item.id === null;
3131
});
3232
} else {

src/lib/entities/qiita-item.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class QiitaItem {
1313
public readonly published: boolean;
1414
public readonly itemPath: string;
1515
public readonly slide: boolean;
16-
public readonly draft: boolean;
16+
public readonly ignorePublish: boolean;
1717

1818
constructor({
1919
id,
@@ -30,7 +30,7 @@ export class QiitaItem {
3030
published,
3131
itemPath,
3232
slide,
33-
draft,
33+
ignorePublish,
3434
}: {
3535
id: string | null;
3636
title: string;
@@ -46,7 +46,7 @@ export class QiitaItem {
4646
published: boolean;
4747
itemPath: string;
4848
slide: boolean;
49-
draft: boolean;
49+
ignorePublish: boolean;
5050
}) {
5151
this.id = id;
5252
this.title = title;
@@ -62,6 +62,6 @@ export class QiitaItem {
6262
this.published = published;
6363
this.itemPath = itemPath;
6464
this.slide = slide;
65-
this.draft = draft;
65+
this.ignorePublish = ignorePublish;
6666
}
6767
}

src/lib/file-system-repo.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class FileContent {
1414
public readonly organizationUrlName: string | null;
1515
public readonly rawBody: string;
1616
public readonly slide: boolean;
17-
public readonly draft: boolean;
17+
public readonly ignorePublish: boolean;
1818

1919
constructor({
2020
title,
@@ -25,7 +25,7 @@ class FileContent {
2525
organizationUrlName,
2626
rawBody,
2727
slide,
28-
draft = false,
28+
ignorePublish = false,
2929
}: {
3030
title: string;
3131
tags: string[];
@@ -35,7 +35,7 @@ class FileContent {
3535
organizationUrlName: string | null;
3636
rawBody: string;
3737
slide: boolean;
38-
draft: boolean;
38+
ignorePublish: boolean;
3939
}) {
4040
this.title = title;
4141
this.tags = tags;
@@ -45,7 +45,7 @@ class FileContent {
4545
this.organizationUrlName = organizationUrlName;
4646
this.rawBody = rawBody;
4747
this.slide = slide;
48-
this.draft = draft;
48+
this.ignorePublish = ignorePublish;
4949
}
5050

5151
static read(fileContent: string): FileContent {
@@ -59,7 +59,7 @@ class FileContent {
5959
id: data.id,
6060
organizationUrlName: data.organization_url_name,
6161
slide: data.slide,
62-
draft: data.draft ?? false,
62+
ignorePublish: data.ignorePublish ?? false,
6363
});
6464
}
6565

@@ -79,7 +79,7 @@ class FileContent {
7979
id,
8080
organizationUrlName: null,
8181
slide: false,
82-
draft: false,
82+
ignorePublish: false,
8383
});
8484
}
8585

@@ -93,7 +93,7 @@ class FileContent {
9393
id: item.id,
9494
organizationUrlName: item.organization_url_name,
9595
slide: item.slide,
96-
draft: false,
96+
ignorePublish: false,
9797
});
9898
}
9999

@@ -107,7 +107,7 @@ class FileContent {
107107
id: item.id,
108108
organizationUrlName: item.organizationUrlName,
109109
slide: item.slide,
110-
draft: item.draft,
110+
ignorePublish: item.ignorePublish,
111111
});
112112
}
113113

@@ -120,7 +120,7 @@ class FileContent {
120120
id: this.id,
121121
organization_url_name: this.organizationUrlName,
122122
slide: this.slide,
123-
draft: this.draft,
123+
ignorePublisht: this.ignorePublish,
124124
});
125125
}
126126

@@ -140,7 +140,8 @@ class FileContent {
140140
this.tags.sort().join() === aFileContent.tags.sort().join() &&
141141
this.secret === aFileContent.secret &&
142142
this.rawBody === aFileContent.rawBody &&
143-
this.slide === aFileContent.slide
143+
this.slide === aFileContent.slide &&
144+
this.ignorePublish === aFileContent.ignorePublish
144145
);
145146
}
146147

@@ -162,7 +163,7 @@ class FileContent {
162163
organizationUrlName: this.organizationUrlName,
163164
rawBody: this.rawBody,
164165
slide: this.slide,
165-
draft: this.draft,
166+
ignorePublish: this.ignorePublish,
166167
});
167168
}
168169
}
@@ -374,7 +375,7 @@ export class FileSystemRepo {
374375
isOlderThanRemote: localFileContent.isOlderThan(remoteFileContent),
375376
itemsShowPath: this.generateItemsShowPath(localFileContent.id, basename),
376377
published: remoteFileContent !== null,
377-
draft: localFileContent.draft,
378+
ignorePublish: localFileContent.ignorePublish,
378379
itemPath,
379380
});
380381
}
@@ -411,7 +412,7 @@ export class FileSystemRepo {
411412
isOlderThanRemote: localFileContent.isOlderThan(remoteFileContent),
412413
itemsShowPath: this.generateItemsShowPath(localFileContent.id, basename),
413414
published: remoteFileContent !== null,
414-
draft: localFileContent.draft,
415+
ignorePublish: localFileContent.ignorePublish,
415416
itemPath,
416417
});
417418
}

0 commit comments

Comments
 (0)