Skip to content

Commit d450fb0

Browse files
committed
Don't overload results.type
1 parent 071192b commit d450fb0

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

src/action/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ async function main(): Promise<void> {
2828
if (results.type === "none") {
2929
console.log(`\n📦 ${results.package} v${results.version} is already published to NPM`);
3030
}
31-
else if (results.type === "dry-run") {
31+
else if (results.dryRun) {
3232
console.log(`\n📦 ${results.package} v${results.version} successfully built but not published to NPM`);
3333
}
3434
else {

src/cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function main(args: string[]): Promise<void> {
3737
if (results.type === "none") {
3838
console.log(`\n📦 ${results.package} v${results.version} is already published to NPM`);
3939
}
40-
else if (results.type === "dry-run") {
40+
else if (results.dryRun) {
4141
console.log(`\n📦 ${results.package} v${results.version} successfully built but not published to NPM`);
4242
}
4343
else {

src/npm-publish.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ export async function npmPublish(opts: Options = {}): Promise<Results> {
2525

2626
let results: Results = {
2727
package: manifest.name,
28-
type: options.dryRun ? "dry-run" : (diff || "none"),
28+
type: diff || "none",
2929
version: manifest.version.raw,
3030
oldVersion: publishedVersion.raw,
31+
dryRun: options.dryRun
3132
};
3233

3334
options.debug("OUTPUT:", results);

src/results.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { ReleaseType } from "semver";
33
export { ReleaseType };
44

55
/**
6-
* Results of the `publish
6+
* Results of the publish
77
*/
88
export interface Results {
99
/**
1010
* The type of version change that occurred
1111
*/
12-
type: ReleaseType | "none" | "dry-run";
12+
type: ReleaseType | "none";
1313

1414
/**
1515
* The name of the NPM package that was published
@@ -25,4 +25,9 @@ export interface Results {
2525
* The version number that was previously published to NPM
2626
*/
2727
oldVersion: string;
28+
29+
/**
30+
* Whether this was a dry run (not published to NPM)
31+
*/
32+
dryRun: boolean;
2833
}

0 commit comments

Comments
 (0)