This repository has been archived by the owner on Aug 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display: Splitted display code with label spec
Signed-Off-By: Progyan Bhattacharya <[email protected]>
- Loading branch information
1 parent
5a5001a
commit 7267dae
Showing
4 changed files
with
48 additions
and
55 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
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 @@ | ||
/* | ||
* GHB - GitHub on Terminal | ||
* Copyright (C) 2017 Progyan Bhattacharya <[email protected]> | ||
* Maintained by: Bytes Club (https://bytesclub.github.io)<[email protected]> | ||
* Distributed under MIT License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const md = require('./markdown.js'), | ||
col = require('./color.js') | ||
|
||
var display = (val) => { | ||
// Title and Issue Number in Yellow fg | ||
// Current State in Magenta bg and White fg | ||
console.log('\x1b[1m\x1b[33m%s #%s\x1b[22m \x1b[45m\x1b[37m%s\x1b[0m', val.title, val.number, val.state) | ||
// Body of issue in White fg | ||
console.log('\x1b[37m%s\x1b[0m', md(val.body)) | ||
val.labels.forEach((label) => { | ||
// Labels associated | ||
console.log('%s%s\x1b[0m\x1b[22m', col(label.color), label.name) | ||
}) | ||
// User-ID of creator in Cyan fg | ||
console.log('\x1b[36mCreated by: %s', val.user.login) | ||
if (val.assignee){ | ||
// Assignee list in Green fg | ||
console.log('\x1b[32mAssigned to:') | ||
val.assignees.forEach((as) => { | ||
console.log('* %s', as.login) | ||
}) | ||
} | ||
// Reset to default | ||
console.log('\x1b[0m') | ||
} | ||
|
||
module.exports = display |
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