update readme

pull/30/head
deadc0de6 1 year ago
parent e501668102
commit 44a13b526f

@ -255,7 +255,7 @@ Each line contains the following fields:
* **indexed_at**: when this entry was indexed * **indexed_at**: when this entry was indexed
* **maccess**: the entry modification date/time * **maccess**: the entry modification date/time
* **md5**: the entry checksum (if any) * **md5**: the entry checksum (if any)
* **nbfiles**: the number of children (empty for not storage or directory nodes) * **nbfiles**: the number of children (empty for nodes that are not storage or directory)
* **free_space**: free space (empty for not storage nodes) * **free_space**: free space (empty for not storage nodes)
* **total_space**: total space (empty for not storage nodes) * **total_space**: total space (empty for not storage nodes)
* **meta**: meta information (empty for not storage nodes) * **meta**: meta information (empty for not storage nodes)

@ -50,12 +50,14 @@ catalog="${tmpd}/catalog"
# index # index
${bin} -B index -c --catalog="${catalog}" github .github ${bin} -B index -c --catalog="${catalog}" github .github
ls -laR .github
cat "${catalog}"
#cat "${catalog}" #cat "${catalog}"
echo "" echo ""
# compare keys # compare keys
echo "compare keys" echo "[+] compare keys"
src="tests-ng/assets/github.catalog.json" src="tests-ng/assets/github.catalog.json"
src_keys="${tmpd}/src-keys" src_keys="${tmpd}/src-keys"
dst_keys="${tmpd}/dst-keys" dst_keys="${tmpd}/dst-keys"
@ -69,7 +71,7 @@ diff "${src_keys}" "${dst_keys}"
echo "ok!" echo "ok!"
# compare children 1 # compare children 1
echo "compare children 1" echo "[+] compare children 1"
src_keys="${tmpd}/src-child1" src_keys="${tmpd}/src-child1"
dst_keys="${tmpd}/dst-child1" dst_keys="${tmpd}/dst-child1"
cat "${src}" | jq '. | select(.type=="top") | .children | .[].name' | sort > "${src_keys}" cat "${src}" | jq '. | select(.type=="top") | .children | .[].name' | sort > "${src_keys}"
@ -82,7 +84,7 @@ diff "${src_keys}" "${dst_keys}"
echo "ok!" echo "ok!"
# compare children 2 # compare children 2
echo "compare children 2" echo "[+] compare children 2"
src_keys="${tmpd}/src-child2" src_keys="${tmpd}/src-child2"
dst_keys="${tmpd}/dst-child2" dst_keys="${tmpd}/dst-child2"
cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[].name' | sort > "${src_keys}" cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[].name' | sort > "${src_keys}"
@ -95,7 +97,7 @@ diff "${src_keys}" "${dst_keys}"
echo "ok!" echo "ok!"
# compare children 3 # compare children 3
echo "compare children 3" echo "[+] compare children 3"
src_keys="${tmpd}/src-child3" src_keys="${tmpd}/src-child3"
dst_keys="${tmpd}/dst-child3" dst_keys="${tmpd}/dst-child3"
cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[] | select(.name=="workflows") | .children | .[].name' | sort > "${src_keys}" cat "${src}" | jq '. | select(.type=="top") | .children | .[] | select(.name=="github") | .children | .[] | select(.name=="workflows") | .children | .[].name' | sort > "${src_keys}"
@ -108,21 +110,21 @@ diff "${src_keys}" "${dst_keys}"
echo "ok!" echo "ok!"
# native # native
echo "compare native output" echo "[+] compare native output"
native="${tmpd}/native.txt" native="${tmpd}/native.txt"
${bin} -B ls -s -r --format=native --catalog="${catalog}" > "${native}" ${bin} -B ls -s -r --format=native --catalog="${catalog}" > "${native}"
mod="${tmpd}/native.mod.txt" mod="${tmpd}/native.mod.txt"
cat "${native}" | sed -e 's/free:.*%/free:0.0%/g' \ cat "${native}" | sed -e 's/free:.*%/free:0.0%/g' \
-e 's/date:....-..-.. ..:..:../date:2023-03-09 16:20:59/g' \ -e 's/date:....-..-.. ..:..:../date:2023-03-09 16:20:59/g' \
-e 's#du:[^|]* |#du:0/0 |#g' > "${mod}" -e 's#du:[^|]* |#du:0/0 |#g' > "${mod}"
if command -v delta; then if command -v delta >/dev/null; then
delta -s "tests-ng/assets/github.catalog.native.txt" "${mod}" delta -s "tests-ng/assets/github.catalog.native.txt" "${mod}"
fi fi
diff --color=always "tests-ng/assets/github.catalog.native.txt" "${mod}" diff --color=always "tests-ng/assets/github.catalog.native.txt" "${mod}"
echo "ok!" echo "ok!"
# csv # csv
echo "compare csv output" echo "[+] compare csv output"
csv="${tmpd}/csv.txt" csv="${tmpd}/csv.txt"
${bin} -B ls -s -r --format=csv --catalog="${catalog}" > "${csv}" ${bin} -B ls -s -r --format=csv --catalog="${catalog}" > "${csv}"
# modify created csv # modify created csv
@ -134,7 +136,7 @@ ori="${tmpd}/ori.mod.txt"
cat "tests-ng/assets/github.catalog.csv.txt" | \ cat "tests-ng/assets/github.catalog.csv.txt" | \
sed 's/....-..-.. ..:..:..//g' | \ sed 's/....-..-.. ..:..:..//g' | \
sed 's/"2","[^"]*","[^"]*",""/"2","0","0",""/g' > "${ori}" sed 's/"2","[^"]*","[^"]*",""/"2","0","0",""/g' > "${ori}"
if command -v delta; then if command -v delta >/dev/null; then
delta -s "${ori}" "${mod}" delta -s "${ori}" "${mod}"
fi fi
diff "${ori}" "${mod}" diff "${ori}" "${mod}"

Loading…
Cancel
Save