"Fossies" - the Fresh Open Source Software Archive

Member "snort3_extra-3.0.3-1/generate_boilerplate.sh" (23 Sep 2020, 648 Bytes) of package /linux/misc/snort3_extra-3.0.3-1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 USAGE="Usage: $0 <start> <expander:./scripts> <templates:./templates>"
    4 
    5 if [ "$1" = "-h" ]; then
    6   echo $USAGE >&2
    7   exit
    8 fi
    9 
   10 RECURSE=${1:-$PWD}
   11 SCRIPT_PATH=./scripts
   12 TEMPLATE_PATH=./templates
   13 
   14 EXPAND=${SCRIPT_PATH}/expand_template.rb
   15 
   16 template=${TEMPLATE_PATH}/CMakeLists.txt.erb
   17 
   18 [ -n "$DRY_RUN" ] && ECHO=echo || ECHO=
   19 
   20 for project_dir in $(find $RECURSE -mindepth 3 -type d); do
   21   project_base=${project_dir##*/}
   22 
   23   template_base=${template##*/}
   24 
   25   [ -n "$DRY_RUN" ] && \
   26     echo $EXPAND $template $project_dir '>' $project_dir/${template_base%.erb} || \
   27     $EXPAND $template $project_dir > $project_dir/${template_base%.erb}
   28 done