File tree Expand file tree Collapse file tree 5 files changed +1081
-5
lines changed
Filter options
Expand file tree Collapse file tree 5 files changed +1081
-5
lines changed
Original file line number Diff line number Diff line change @@ -55,3 +55,4 @@ Run with the `--verbose` flag to see debug information
55
55
| --skip-forks | Skips forked repositories | false |
56
56
| --old | The name of the branch to rename | master |
57
57
| --new | The new branch name | main |
58
+ | --confirm | Run without prompting for confirmation | false |
Original file line number Diff line number Diff line change 33
33
34
34
const { Octokit } = require ( "@octokit/rest" ) ;
35
35
36
+ const confirmation = require ( "../src/confirmation" ) ;
36
37
const getRepos = require ( "../src/get-repos" ) ;
37
38
const getBranchSha = require ( "../src/get-branch-sha" ) ;
38
39
const createBranch = require ( "../src/create-branch" ) ;
39
40
const removeBranch = require ( "../src/remove-branch" ) ;
40
41
const updateContent = require ( "../src/update-content" ) ;
41
42
43
+ const old = argv . old || "master" ;
44
+ const target = argv . new || "main" ;
45
+
46
+ // Make sure they want to do this
47
+ if ( ! ( await confirmation ( argv . confirm , old , target ) ) ) {
48
+ return ;
49
+ }
50
+
42
51
const octokit = new Octokit ( {
43
52
auth : argv . pat || process . env . GITHUB_TOKEN ,
44
53
} ) ;
58
67
console . log ( repos . join ( "\n" ) ) ;
59
68
return ;
60
69
}
61
-
62
- const old = argv . old || "master" ;
63
- const target = argv . new || "main" ;
64
-
65
70
for ( let r of repos ) {
66
71
if ( argv . verbose ) {
67
72
console . log ( `✏️ Processing ${ r } ` ) ;
You can’t perform that action at this time.
0 commit comments