Skip to content

Instantly share code, notes, and snippets.

@sowe
Last active December 12, 2017 18:25
Show Gist options
  • Save sowe/ad048a0a81f4d0245c602b3d7efae47a to your computer and use it in GitHub Desktop.
Save sowe/ad048a0a81f4d0245c602b3d7efae47a to your computer and use it in GitHub Desktop.
Script para hacer una check basico a las etl
#!/bin/bash
set -e
set -u
readonly CAMELCASE='\b[A-Z]+(_[A-Z]+)*\b';
readonly SANKCASE='\b[A-Z]([A-Z0-9]*[a-z][a-z0-9]*[A-Z]|[a-z0-9]*[A-Z][A-Z0-9]*[a-z])[A-Za-z0-9]*\b';
FULL_OK="false"
function _console(){
local message=${1:-''}
[[ -n "$message" ]] && echo -e "$message"
}
function _die(){
local message=${1:-''}
local exit_code=${2:-0}
_console "$message"
exit $exit_code
}
function checkFileName(){
local dir=${1:-'.'}
find $dir -type f -printf "%f\n" -exec grep -l $CAMELCASE {} +
find $dir -type f -exec grep -l $CAMELCASE {} +
for file in $dir/*; do
if [[ "$file" == $CAMELCASE ]] ; then
echo "$string in $file"
else
echo "no match for $file"
fi
}
function checkStepName(){
grep -oP $CAMELCASE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment