This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/000_validate.sh

64 lines
2.6 KiB
Bash
Raw Normal View History

2021-05-17 15:05:14 +02:00
#!/bin/bash
echo "Validating inx files with xmllint. Only errors are printed to console"
for folder in */ ; do xmllint --noout --relaxng ./inkscape.extension.rng $folder*.inx > /dev/null 2>> 000_xmllint.out; done; grep -v "validates\|warning: failed to load external entity" 000_xmllint.out; rm 000_xmllint.out
2021-06-11 13:54:31 +02:00
2021-05-17 15:05:14 +02:00
echo "Count of inx files:"
2021-07-07 23:51:13 +02:00
INX=$(find ./ -type f -name "*.inx" | wc -l)
echo INX: $INX
2021-06-11 13:54:31 +02:00
2021-05-17 15:05:14 +02:00
echo "Count of extension folders:"
2021-07-07 23:51:13 +02:00
FOLDERS=$(ls -d */ | wc -l)
echo FOLDERS: $FOLDERS
2021-07-07 23:51:13 +02:00
README="../../README.md"
#replace values in README.md
sed -i 's/\*\*.* extension folders\*\*/\*\*'${FOLDERS}' extension folders\*\*/g' ${README}
sed -i 's/\*\* with .* \.inx files\*\*/\*\* with \*\*'${INX}' \.inx files\*\*/g' ${README}
2021-06-11 13:54:31 +02:00
echo "Removing unrequired pyc cache files"
find . -type d -name "__pycache__" -exec rm -rf {} \;
2021-06-11 13:54:31 +02:00
read -p "Build local gallery extension zip files?" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "Building Inkscape gallery extension zip files"
TARGETDIR="../000_Inkscape_Gallery"
mkdir -p $TARGETDIR > /dev/null
#list of extensions which are uploaded at Inkscape gallery by us at the moment
for EXTENSION in \
"animate_order" \
"cleanup_styles" \
"contour_scanner_and_trimmer" \
"convert_to_polylines" \
"create_links" \
"dxf2papercraft" \
"dxf_dwg_importer" \
"imagetracerjs" \
"inventory_sticker" \
"move_path_node" \
"remove_empty_groups" \
"offset_paths" \
"papercraft_unfold" \
"paperfold" \
"primitive" \
"slic3r_stl_input" \
"split_and_break_bezier_at_t" \
"styles_to_layers" \
"ungrouper_and_element_migrator_filter" \
"unwind_paths" \
"vpypetools"
do
EXTRA=""
if [[ $EXTENSION == "styles_to_layers" ]] || [[ $EXTENSION == "ungrouper_and_element_migrator_filter" ]]; then
EXTRA="${EXTRA} apply_transformations/"
elif [[ $EXTENSION == "styles_to_layers" ]] || [[ $EXTENSION == "ungrouper_and_element_migrator_filter" ]]; then
EXTRA="${EXTRA} remove_empty_groups/"
fi
ZIPFILE=$TARGETDIR/$EXTENSION.zip
rm $ZIPFILE > /dev/null
zip -r $ZIPFILE $EXTENSION/ 000_about_fablabchemnitz.svg $EXTRA
done
fi