generated from trustoverip/specification-template
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmove_images.sh
executable file
·28 lines (21 loc) · 923 Bytes
/
move_images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Define the base directories
SOURCE_BASE="./specification"
DEST_BASE="./dist"
# Find all 'images' directories under the source base
IMAGES_DIRS=$(find "$SOURCE_BASE" -type d -name "images")
for DIR in $IMAGES_DIRS; do
# Compute the destination path by replacing the source base with the destination base
DEST_PATH="${DIR/$SOURCE_BASE/$DEST_BASE}"
# Ensure the destination directory exists
mkdir -p "$DEST_PATH"
# Move all files within the images directory to the destination
cp -r "$DIR"/* "$DEST_PATH"
done
mkdir -p dist/v2/bindings/restful/
mkdir -p dist/v3/bindings/restful/
mkdir -p dist/images
cp specification/v2/bindings/restful/swagger.yaml dist/v2/bindings/restful/swagger.yaml
cp specification/v3/bindings/restful/swagger.yaml dist/v3/bindings/restful/swagger.yaml
cp specification/v3/bindings/restful/swagger.yaml dist/swagger.yaml
cp -r specification/v3/images dist/