mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2024-11-23 12:54:04 +00:00
[project] ready to publish all subs customized
This commit is contained in:
parent
c8f0e23704
commit
5978159d9e
|
@ -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"
|
||||
},
|
||||
|
|
27
scripts/copy_to_all_subs.sh
Normal file
27
scripts/copy_to_all_subs.sh
Normal 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."
|
Loading…
Reference in a new issue