https://github.com/brenordv/githook-ps-check-forbidden-texts
https://github.com/brenordv/githook-ps-check-forbidden-texts
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brenordv/githook-ps-check-forbidden-texts
- Owner: brenordv
- Created: 2021-04-13T21:50:52.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-14T13:53:54.000Z (about 4 years ago)
- Last Synced: 2025-01-20T08:13:09.040Z (5 months ago)
- Language: PowerShell
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Checking source for forbidden strings.
A simple script to check all .TS files for pre-configured strings.
It's pre-configured to check for the word ```debugger``` and ```console.*```.## Notes
This script was made to work with Angular (*.ts) files, but this can be easly changed.# How to use
Add the following code to the ```pre-push``` hook:
```shell
#!/bin/sh
scriptDir=$(PWD)/ci/hooks/Check-HasForbiddenStrings.ps1
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -File $scriptDir -path $(PWD)
```The example above runs a powershell script that's located on ```/ci/hooks```. If yours is in a different path, feel free to change it.
In all my tests, PWD returned the repo path. I'm not sure if this will happen if it's a bare repo.
# This repo url
https://github.com/brenordv/githook-ps-check-forbidden-texts