Skip to content

fix: double quotes #4

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
Jul 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions bin/github-default-branch
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#!/usr/bin/env node
(async function () {
const { argv } = require("yargs").options({
pat: {type: 'string', description: 'GitHub API Token'},
repo: {type: 'string', description: 'The repo to update (format: user/repo'},
user: {type: 'string', description: 'Update all repos owned by the provided user (example: my-user)'},
org: {type: 'string', description: 'Update all repos in the provided org (example: my-org-name)'},
keepOld: {type: 'boolean', default: false, description: 'Keep the old branch rather than deleting it'},
dryRun: {type: 'boolean', default: false, description: 'Output log messages only. Do not make any changes'},
listReposOnly: {type: 'boolean', default: false, description: 'List repos that would be affected, then exit'},
skipForks: {type: 'boolean', default: false, description: 'Skips forked repositories'},
old: {type: 'string', default: 'master', description: 'The name of the branch to rename'},
new: {type: 'string', default: 'main', description: 'The new branch name'},
confirm: {type: 'boolean', default: false, description: 'Run without prompting for confirmation'},
pat: {type: "string", description: "GitHub API Token"},
repo: {type: "string", description: "The repo to update (format: user/repo"},
user: {type: "string", description: "Update all repos owned by the provided user (example: my-user)"},
org: {type: "string", description: "Update all repos in the provided org (example: my-org-name)"},
keepOld: {type: "boolean", default: false, description: "Keep the old branch rather than deleting it"},
dryRun: {type: "boolean", default: false, description: "Output log messages only. Do not make any changes"},
listReposOnly: {type: "boolean", default: false, description: "List repos that would be affected, then exit"},
skipForks: {type: "boolean", default: false, description: "Skips forked repositories"},
old: {type: "string", default: "master", description: "The name of the branch to rename"},
new: {type: "string", default: "main", description: "The new branch name"},
confirm: {type: "boolean", default: false, description: "Run without prompting for confirmation"},
}).example([
['$0 --pat <token> --repo user/repo', 'Rename master to main'],
['$0 --pat <token> --repo user/repo --old dev --new develop', 'Rename dev to develop'],
['$0 --pat <token> --org my-org-name', 'Rename all repos owned by an org'],
['$0 --pat <token> --user my-user', 'Rename all repos owned by a user'],
["$0 --pat <token> --repo user/repo", "Rename master to main"],
["$0 --pat <token> --repo user/repo --old dev --new develop", "Rename dev to develop"],
["$0 --pat <token> --org my-org-name", "Rename all repos owned by an org"],
["$0 --pat <token> --user my-user", "Rename all repos owned by a user"],
]);

const isDryRun = !!argv.dryRun;
Expand Down