mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00

All changes in this patch were performed automatically with `shfmt` with configuration flags specified in `.pre-commit-config.yaml`. In addition to fixing whitespace the roundtrip through shfmt's AST also transforms command substitutions `cmd` # becomes $(cmd) and some redirects >&2 echo "msg" # becomes echo >&2 "msg"
43 lines
743 B
Bash
Executable file
43 lines
743 B
Bash
Executable file
#! /usr/bin/env bash
|
|
#
|
|
# Helper script for creating new external testing repos. See the
|
|
# README for details.
|
|
|
|
cwd=$(pwd)
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "usage: $0 <name> [<dst-repo-url>]"
|
|
exit 1
|
|
fi
|
|
|
|
name=$(pwd)/$1
|
|
repo=$2
|
|
|
|
if [ -e $name ]; then
|
|
echo "$name already exists, aborting."
|
|
exit 1
|
|
fi
|
|
|
|
mkdir $name
|
|
cd $name
|
|
git init
|
|
|
|
for dir in tests Baseline; do
|
|
mkdir $dir
|
|
touch $dir/.gitignore
|
|
done
|
|
|
|
ln -s ../subdir-btest.cfg ./btest.cfg
|
|
|
|
cp $cwd/$(dirname $0)/skel/test.skeleton tests
|
|
cp $cwd/$(dirname $0)/skel/traces.cfg .
|
|
cp $cwd/$(dirname $0)/skel/Makefile .
|
|
cp $cwd/$(dirname $0)/skel/.gitignore .
|
|
|
|
git add * .gitignore
|
|
|
|
git commit -m "Repository initialized."
|
|
|
|
if [ -n "$repo" ]; then
|
|
git remote add origin $repo
|
|
fi
|