-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
839 additions
and
745 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
node_modules/ | ||
runner/ | ||
.terraform/ | ||
.cml/ | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
exports.command = 'attachment'; | ||
exports.description = false; | ||
exports.builder = (yargs) => | ||
yargs | ||
.commandDir('./attachment', { exclude: /\.test\.js$/ }) | ||
.recommendCommands() | ||
.demandCommand() | ||
.strict(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
exports.command = 'check'; | ||
exports.description = 'Manage continuous integration checks'; | ||
exports.builder = (yargs) => | ||
yargs | ||
.commandDir('./check', { exclude: /\.test\.js$/ }) | ||
.recommendCommands() | ||
.demandCommand() | ||
.strict(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,12 @@ | ||
const kebabcaseKeys = require('kebabcase-keys'); | ||
|
||
const { GIT_REMOTE, GIT_USER_NAME, GIT_USER_EMAIL } = require('../../src/cml'); | ||
const CML = require('../../src/cml').default; | ||
|
||
exports.command = 'pr <glob path...>'; | ||
exports.description = 'Create a pull request with the specified files'; | ||
|
||
exports.handler = async (opts) => { | ||
const cml = new CML(opts); | ||
const link = await cml.prCreate({ ...opts, globs: opts.globpath }); | ||
if (link) console.log(link); | ||
}; | ||
|
||
exports.builder = (yargs) => yargs.env('CML_PR').options(options); | ||
|
||
const options = kebabcaseKeys({ | ||
md: { | ||
type: 'boolean', | ||
description: 'Output in markdown format [](url).' | ||
}, | ||
skipCI: { | ||
type: 'boolean', | ||
description: 'Force skip CI for the created commit (if any)' | ||
}, | ||
merge: { | ||
type: 'boolean', | ||
alias: 'auto-merge', | ||
conflicts: ['rebase', 'squash'], | ||
description: 'Try to merge the pull request upon creation.' | ||
}, | ||
rebase: { | ||
type: 'boolean', | ||
conflicts: ['merge', 'squash'], | ||
description: 'Try to rebase-merge the pull request upon creation.' | ||
}, | ||
squash: { | ||
type: 'boolean', | ||
conflicts: ['merge', 'rebase'], | ||
description: 'Try to squash-merge the pull request upon creation.' | ||
}, | ||
remote: { | ||
type: 'string', | ||
default: GIT_REMOTE, | ||
description: 'Sets git remote.' | ||
}, | ||
userEmail: { | ||
type: 'string', | ||
default: GIT_USER_EMAIL, | ||
description: 'Sets git user email.' | ||
}, | ||
userName: { | ||
type: 'string', | ||
default: GIT_USER_NAME, | ||
description: 'Sets git user name.' | ||
} | ||
}); | ||
const { options, handler } = require('./pr/create'); | ||
|
||
exports.command = 'pr'; | ||
exports.description = 'Manage pull requests'; | ||
exports.handler = handler; | ||
exports.builder = (yargs) => | ||
yargs | ||
.commandDir('./pr', { exclude: /\.test\.js$/ }) | ||
.recommendCommands() | ||
.env('CML_PR') | ||
.options(options) | ||
.strict(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
const kebabcaseKeys = require('kebabcase-keys'); | ||
|
||
const { | ||
GIT_REMOTE, | ||
GIT_USER_NAME, | ||
GIT_USER_EMAIL | ||
} = require('../../../src/cml'); | ||
const CML = require('../../../src/cml').default; | ||
|
||
exports.command = 'create <glob path...>'; | ||
exports.description = 'Create a pull request with the specified files'; | ||
|
||
exports.handler = async (opts) => { | ||
const cml = new CML(opts); | ||
const link = await cml.prCreate({ ...opts, globs: opts.globpath }); | ||
if (link) console.log(link); | ||
}; | ||
|
||
exports.builder = (yargs) => yargs.env('CML_PR').options(exports.options); | ||
|
||
exports.options = kebabcaseKeys({ | ||
md: { | ||
type: 'boolean', | ||
description: 'Output in markdown format [](url).' | ||
}, | ||
skipCI: { | ||
type: 'boolean', | ||
description: 'Force skip CI for the created commit (if any)' | ||
}, | ||
merge: { | ||
type: 'boolean', | ||
alias: 'auto-merge', | ||
conflicts: ['rebase', 'squash'], | ||
description: 'Try to merge the pull request upon creation.' | ||
}, | ||
rebase: { | ||
type: 'boolean', | ||
conflicts: ['merge', 'squash'], | ||
description: 'Try to rebase-merge the pull request upon creation.' | ||
}, | ||
squash: { | ||
type: 'boolean', | ||
conflicts: ['merge', 'rebase'], | ||
description: 'Try to squash-merge the pull request upon creation.' | ||
}, | ||
remote: { | ||
type: 'string', | ||
default: GIT_REMOTE, | ||
description: 'Sets git remote.' | ||
}, | ||
userEmail: { | ||
type: 'string', | ||
default: GIT_USER_EMAIL, | ||
description: 'Sets git user email.' | ||
}, | ||
userName: { | ||
type: 'string', | ||
default: GIT_USER_NAME, | ||
description: 'Sets git user name.' | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
exports.command = 'report'; | ||
exports.description = 'Manage reports'; | ||
exports.builder = (yargs) => | ||
yargs | ||
.commandDir('./report', { exclude: /\.test\.js$/ }) | ||
.recommendCommands() | ||
.demandCommand() | ||
.strict(); |
Oops, something went wrong.