Skip to content

Commit

Permalink
Merge pull request #100 from hipstersmoothie/deprecate
Browse files Browse the repository at this point in the history
Deprecate --major --minor --patch flags
  • Loading branch information
hipstersmoothie authored Dec 18, 2018
2 parents 769a150 + 5625e18 commit 18188e1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 41 deletions.
3 changes: 0 additions & 3 deletions docs/pages/auto-pr-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ Options
--pr number [required] The pull request number you want the labels of
--url string URL to associate with this status
--onlyPublishWithReleaseLabel Only bump version if 'release' label is on pull request
--major string The name of the tag for a major version bump
--minor string The name of the tag for a minor version bump
--patch string The name of the tag for a patch version bump
--context string A string label to differentiate this status from others
--noReleaseLabels string[] Labels that will not create a release. Defaults to just 'no-release'

Expand Down
3 changes: 0 additions & 3 deletions docs/pages/auto-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ Get the semantic version bump for the given changes. Requires all PRs to have la
Options

--onlyPublishWithReleaseLabel Only bump version if 'release' label is on pull request
--major string The name of the tag for a major version bump
--minor string The name of the tag for a minor version bump
--patch string The name of the tag for a patch version bump
--noReleaseLabels string[] Labels that will not create a release. Defaults to just 'no-release'

Global Options
Expand Down
30 changes: 2 additions & 28 deletions src/cli/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,29 +121,6 @@ const onlyPublishWithReleaseLabel: commandLineUsage.OptionDefinition = {
group: 'main'
};

const major: commandLineUsage.OptionDefinition = {
name: 'major',
type: String,
description: 'The name of the tag for a major version bump',
group: 'main'
};

const minor: commandLineUsage.OptionDefinition = {
name: 'minor',
type: String,
description: 'The name of the tag for a minor version bump',
group: 'main'
};

const patch: commandLineUsage.OptionDefinition = {
name: 'patch',
type: String,
description: 'The name of the tag for a patch version bump',
group: 'main'
};

const semver = [onlyPublishWithReleaseLabel, major, minor, patch];

const name: commandLineUsage.OptionDefinition = {
name: 'name',
type: String,
Expand Down Expand Up @@ -224,7 +201,7 @@ const commands: ICommand[] = [
options: [
pr,
url,
...semver,
onlyPublishWithReleaseLabel,
{
...context,
defaultValue: 'ci/pr-check'
Expand Down Expand Up @@ -278,7 +255,7 @@ const commands: ICommand[] = [
{
name: 'version',
summary: 'Get the semantic version bump for the given changes.',
options: [...semver, noReleaseLabels, ...defaultOptions],
options: [onlyPublishWithReleaseLabel, noReleaseLabels, ...defaultOptions],
examples: [
{
desc: 'Get the new version using the last release to head',
Expand Down Expand Up @@ -546,9 +523,6 @@ export default function parseArgs(testArgs?: string[]) {
export interface ISemverArgs {
noReleaseLabels?: string[];
onlyPublishWithReleaseLabel?: boolean;
major?: string;
minor?: string;
patch?: string;
jira?: string;
slack?: string;
githubApi?: string;
Expand Down
7 changes: 0 additions & 7 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,6 @@ export async function run(args: ArgsType) {

verbose.success('Loaded `auto-release` with config:', rawConfig);

Object.entries(args).forEach(([key, val]) => {
// tslint:disable-next-line
if (val === null) {
delete (args as any)[key];
}
});

const config: IGithubReleaseOptions = {
...rawConfig,
...args,
Expand Down

0 comments on commit 18188e1

Please sign in to comment.