reorg repo
This commit is contained in:
7
server/testdata/fill_tree.sh
vendored
Normal file
7
server/testdata/fill_tree.sh
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
#! /bin/bash
|
||||
|
||||
curl localhost:3004/api/v0/files/A -X PUT -d 'A' -H 'Title: A'
|
||||
curl localhost:3004/api/v0/files/A/AA -X PUT -d 'AA' -H 'Title: AA'
|
||||
curl localhost:3004/api/v0/files/A/AA/AAA -X PUT -d 'AAA' -H 'Title: AAA'
|
||||
curl localhost:3004/api/v0/files/A/AB -X PUT -d 'AB' -H 'Title: AB'
|
||||
curl localhost:3004/api/v0/files/B -X PUT -d 'B' -H 'Title: B'
|
||||
21
server/testdata/runbooks_to_files.sh
vendored
Normal file
21
server/testdata/runbooks_to_files.sh
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
#! /bin/bash
|
||||
|
||||
cd "$(dirname "$BASH_SOURCE")"
|
||||
files_d="$PWD/files"
|
||||
runbooks_d="$HOME/repos/runbooks"
|
||||
find "$runbooks_d" -type f -name "*.md" | while read -r line; do
|
||||
relative="${line#$runbooks_d/}"
|
||||
echo relative=$relative
|
||||
mkdir -p "$files_d"/"${relative%.md}"
|
||||
content="$(cat "$line" | jq -sR)"
|
||||
printf '{
|
||||
"content": %s,
|
||||
"title": "%s"
|
||||
}' "$content" "${relative##*/}" > "$files_d"/"${relative%.md}"/data.yaml
|
||||
done
|
||||
find "$files_d" -type d | while read -r files_d; do
|
||||
echo asserting "$files_d/data.yaml"
|
||||
if [ ! -f "$files_d"/data.yaml ]; then
|
||||
printf '{"title": "%s"}' "${files_d##*/}" > "$files_d"/data.yaml
|
||||
fi
|
||||
done
|
||||
1
server/testdata/ui
vendored
Symbolic link
1
server/testdata/ui
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../../ui/
|
||||
Reference in New Issue
Block a user