Added automatisation script build_bundle.zsh, which strips unwanted features fron .nb files and also packs everything into tag.gz archive

This commit is contained in:
Artyom Titov 2026-07-30 16:01:43 +03:00
commit 42db7fd9ce
5 changed files with 37 additions and 2 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
./automation/bundle.tar.gz

View file

@ -1,2 +0,0 @@
RowBox[{"x", "=",
RowBox[{"Plot", "[",

36
automation/build_bundle.zsh Executable file
View file

@ -0,0 +1,36 @@
#!/bin/zsh
BOLD='\033[1m'
REGULAR='\033[0m'
target_dir="Pu240_798-811_TitovAA"
target_path=$(find ../ -type d -name "$target_dir" -print -quit)
read -r "USER_AGREE?%B$target_path%b will be used as bundle source [Y/n]: "
USER_AGREE="${USER_AGREE:l}"
if [[ "$USER_AGREE" == "q" ]]; then
print "Bundle\'s making canceled"
exit
fi
if ! [[ -z "$USER_AGREE" || "$USER_AGREE" == "y" || "$USER_AGREE" == "yes" ]]; then
read -r "target_path?Enter path to bundle source: "
fi
dirname="${target_path:A:t}"
tmp_dir=$(mktemp -d /tmp/XXXXX)
#tmp_dir="/tmp/bundle"
cp -r "$target_path" "$tmp_dir"
for dir in "$tmp_dir/$dirname"/*(/); do
find "$dir" -type f -iname "rename*" -exec rm -f {} \;
/usr/bin/env python ./clean_wolfram_notebook.py "$dir"/* --in-place
done
find "$tmp_dir" -type f -iname "*.bak" -exec rm -f {} \;
tar -cvzf bundle.tar.gz -C "$tmp_dir" "$dirname"
rm -rf "$tmp_dir"

BIN
automation/bundle.tar.gz Normal file

Binary file not shown.