Skip to content

added optionality for git output tabs #92

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions actions/gitStatusProcess.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
const {showFlag} = require('../styleFile')

const gitStatusProcess = (gitStatusOutput) => {
let gitStatusOutputSorted = {
staged: [],
unstaged: [],
}


//Checks and outputs what the status of a file is.
//Specifically, modified/deleted/added files
gitStatusOutput.split('\n').forEach(line => {
const tag1 = line.slice(0,1)
const tag2 = line.slice(1,2)
const tags = line.slice(0,2)
let displayTags = ''
if (showFlag === true) displayTags = `(${tags})`

if (tag1 !== ' ' && tag1 !== '?' && line.length) {
gitStatusOutputSorted.staged.push(`- ${line.slice(3)} (${line.slice(0,2)})`)
gitStatusOutputSorted.staged.push(`- ${line.slice(3)} ${displayTags}`)
}
if (tag2 !== ' ' && line.length) {
gitStatusOutputSorted.unstaged.push(`- ${line.slice(3)} (${line.slice(0,2)})`)
gitStatusOutputSorted.unstaged.push(`- ${line.slice(3)} ${displayTags}`)
}
})

Expand Down
1 change: 1 addition & 0 deletions actions/gitStatusPull.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ const statusOutput = () => {
}

module.exports = statusOutput;
//test
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ When you open the file it will look like this:
* ### **`appResize`:**
- This enables the app to be responsive, allowing users to resize their console windows without having to restart the app. This may decrease performance for some users.

* ### **`showFlag`:**
- Allows user to chose whether or not to display git output tags by the staged/unstaged files.
- Set to `false` by default.
- see [here](https://git-scm.com/docs/git-status) for more info about git output tags
---

### **FAQs**
Expand Down
4 changes: 4 additions & 0 deletions styleFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ module.exports = {

// setting to determine whether app dynamically adjusts to screen resizing; setting to false may improve performance
appResize: true, // acepted values include [true, false]

// setting to to determine whether or not app shows git flags by staged/unstaged files
showFlag: false, // acepted values include [true, false]

}