Last active
July 25, 2018 06:20
-
-
Save stella3d/76adf13b450ea0b2255bd5d184e43d88 to your computer and use it in GitHub Desktop.
Hide *.meta & *.asset files, and load large diffs by default
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
const filesContainer = document.querySelector('div#files'); | |
filesContainer.querySelectorAll('div.js-details-container').forEach(div => { | |
let fileHeader = div.querySelector('div.file-header'); | |
let filePath = fileHeader.getAttribute('data-path'); | |
let isMetaFile = filePath.endsWith('.meta'); | |
let isDotAssetFile = filePath.endsWith('.asset'); | |
let shouldHide = isMetaFile || isDotAssetFile; | |
let loadDiffButton = div.querySelector('button.load-diff-button'); | |
if(loadDiffButton != null && !shouldHide) { | |
loadDiffButton.click(); | |
} | |
if(shouldHide) { | |
div.style.display = 'none'; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Paste this into the console when on the /files page of your pull request.
This may break when GitHub changes things.