Skip to content

Instantly share code, notes, and snippets.

@sliekens
Last active May 5, 2019 18:53
Show Gist options
  • Save sliekens/53713fcdb81a2fa07d6d7403efce8221 to your computer and use it in GitHub Desktop.
Save sliekens/53713fcdb81a2fa07d6d7403efce8221 to your computer and use it in GitHub Desktop.
CI Scripts
# Check the working directory for modified files
# Exit with an error if there are any
$modified = git ls-files --modified
if ($modified -ne $null) {
Write-Error "Working directory contains modified files: $modified"
exit 1
}
# Check for untracked files that are not covered by Git exclusions
# (.git/info/exclude, .gitignore in each directory, and the user’s global exclusion file.)
# Exit with an error if there are any
$untracked = git ls-files --others --exclude-standard
if ($untracked -ne $null) {
Write-Error "Commit these files or add them to gitignore: $untracked"
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment