-
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.
- Loading branch information
Alicia Lopez
committed
Aug 18, 2020
1 parent
0003ab7
commit fdd7242
Showing
2 changed files
with
66 additions
and
0 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,38 @@ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const { readJson } = require('./../../lib/file'); | ||
const { getNcuDir } = require('./../../lib/config'); | ||
|
||
const CLI = require('../../lib/cli'); | ||
|
||
const cli = new CLI(); | ||
|
||
function handler() { | ||
const ncuDir = getNcuDir(process.cwd()); | ||
const landPath = path.join(ncuDir, 'land'); | ||
|
||
if (fs.existsSync(landPath)) { | ||
const { state, prid, config } = readJson(landPath); | ||
const { username, branch, upstream } = config; | ||
|
||
cli.ok('Landing session in progress'); | ||
cli.separator(); | ||
cli.table('PR:', `https:/github.com/nodejs/node/pull/${prid}`); | ||
cli.table('State:', state); | ||
cli.table('Username:', username); | ||
cli.table('Upstream:', upstream); | ||
cli.table('Branch:', branch); | ||
} else { | ||
cli.warn('No landing session in progress'); | ||
} | ||
} | ||
|
||
module.exports = { | ||
command: 'status', | ||
describe: 'Return status and information about' + | ||
'the current git-node land session.', | ||
handler: handler | ||
}; |
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