Created
June 7, 2020 14:34
-
-
Save javascripto/8433d135bda0fdc2d550a25fe97cc4cc to your computer and use it in GitHub Desktop.
Angular lint staged
This file contains hidden or 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
| #!/bin/bash | |
| lint-staged() { | |
| # ng lint --files $(git diff --name-only --cached | tr '\n' ' ') | |
| staged_files=$(git diff --name-only --cached) | |
| staged_files_inline=$(echo $staged_files | tr '\n' ' ') | |
| command="ng lint --files $staged_files_inline" | |
| # if not null | |
| if [ ! -z "$staged_files" ]; then | |
| echo $command # $(echo command) # executa | |
| fi | |
| } | |
| lint-staged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment