forked from Abhinandan-Kushwaha/gifted-charts-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·21 lines (18 loc) · 717 Bytes
/
Copy pathbuild.sh
File metadata and controls
executable file
·21 lines (18 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
# Source and destination directories
SRC_DIR="./src"
DST_DIR="./dist"
# Create the destination directory if it doesn't exist
mkdir -p "$DST_DIR"
# Find and move all .js and .d.ts files while preserving the directory structure
find "$SRC_DIR" -type f \( -name '*.js' -o -name '*.d.ts' -o -name '*.js.map' \) | while read -r file; do
# Get the relative path of the file
rel_path="${file#$SRC_DIR/}"
# Get the directory of the file
file_dir=$(dirname "$rel_path")
# Create the directory in the destination if it doesn't exist
mkdir -p "$DST_DIR/$file_dir"
# Move the file to the destination
mv "$file" "$DST_DIR/$rel_path"
echo "Moved $file to $DST_DIR/$rel_path"
done