[project] ready to publish all subs customized

This commit is contained in:
Revone 2023-10-25 10:40:39 +08:00
parent c8f0e23704
commit 5978159d9e
2 changed files with 29 additions and 1 deletions

View file

@ -34,7 +34,8 @@
"changelog": "auto-changelog",
"coverage:badge": "istanbul-badges-readme",
"ci": "env && git fetch --tags && npm run lint && npm run build && npm run update:subs && npm run test && npm run changelog",
"publish:subs": "sh scripts/publish_all_subs.sh",
"copy:to-subs": "sh scripts/copy_to_all_subs.sh",
"publish:subs": "npm run copy:to-subs && sh scripts/publish_all_subs.sh",
"publish:docs": "sh scripts/publish_docs.sh",
"publish:all": "npm run ci && npm publish && npm run publish:subs && npm run publish:docs"
},

View file

@ -0,0 +1,27 @@
#!/bin/bash
# Enable extended globbing
shopt -s extglob
# target directory
individuals_dir_default=$(jq -r .individualsDir ./scripts/config.json)
# Source directory
source_dir_default=$(jq -r .sourceDir ./scripts/config.json)
# List of directories
directories=(
"avl-tree-typed"
)
# Loop through each directory
for dir in "${directories[@]}"; do
# Delete all files except index.ts
find "$individuals_dir_default"/"$dir"/src -type f ! -name 'index.ts' -delete
# Copy the files to the target directory, excluding index.ts
cp -R "$source_dir_default"/src/!(index.ts) "$individuals_dir_default"/"$dir"/src
done
echo "All packages copied."