-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from upfrontIO/refactoring-to-node-release-tools
Refactor create-release-branch script to a node executable
- Loading branch information
Showing
29 changed files
with
291 additions
and
392 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "standard" | ||
} |
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,3 +1,4 @@ | ||
npm-debug.log | ||
.DS_Store | ||
node_modules | ||
package-lock.json |
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,10 @@ | ||
#!/usr/bin/env node | ||
const yargs = require('yargs') | ||
const commands = require('./cmd_init') | ||
|
||
// Init CLI commands and options | ||
commands.forEach(cmd => yargs.command(cmd.command, cmd.desc, cmd.builder, cmd.handler)) | ||
yargs | ||
.help() | ||
.demand(1) | ||
.argv |
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,36 @@ | ||
const camelCase = require('camelcase') | ||
const requireDir = require('require-dir') | ||
const colors = require('chalk') | ||
const shell = require('shelljs') | ||
shell.set('-e') | ||
const { join, resolve } = require('path') | ||
const pkg = require(join(__dirname, '../package.json')) | ||
|
||
// External dependencies to pass to the commands | ||
let dep = { | ||
join, | ||
resolve, | ||
console, | ||
colors, | ||
shell, | ||
process, | ||
releaseConfig: pkg.release | ||
} | ||
|
||
// Internal dependencies (modules) | ||
const inDepFns = requireDir(join(__dirname, '..', 'lib', 'modules')) | ||
Object.keys(inDepFns).forEach(name => { | ||
dep[camelCase(name)] = inDepFns[name](dep) | ||
}) | ||
|
||
// Internal dependencies (shell) | ||
const shellFns = requireDir(join(__dirname, '..', 'lib', 'shell')) | ||
Object.keys(shellFns).forEach(name => { | ||
dep[camelCase(name)] = shellFns[name](dep) | ||
}) | ||
|
||
// Load commands from folder and pass dependencies | ||
const commandsFn = requireDir(join(__dirname, '..', 'lib', 'commands')) | ||
const commands = Object.keys(commandsFn).map((i) => commandsFn[i](dep)) | ||
|
||
module.exports = commands |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.