-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·38 lines (30 loc) · 884 Bytes
/
build.sh
File metadata and controls
executable file
·38 lines (30 loc) · 884 Bytes
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
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Define the target directory and items to copy
TARGET_DIR="altapay-master"
DIRECTORIES=("src" "ci") # List of directories to copy
FILES=("composer.json" ".gitlab-ci.yml" ".gitignore") # List of files to copy
# Remove zip file
rm "${TARGET_DIR}.zip"
# Create the target directory
mkdir -p "$TARGET_DIR"
# Copy directories
for DIR in "${DIRECTORIES[@]}"; do
if [ -d "$DIR" ]; then
cp -r "$DIR" "$TARGET_DIR/"
else
echo "Directory $DIR does not exist. Skipping."
fi
done
# Copy files
for FILE in "${FILES[@]}"; do
if [ -f "$FILE" ]; then
cp "$FILE" "$TARGET_DIR/"
else
echo "File $FILE does not exist. Skipping."
fi
done
# Zip the target directory
zip -r "${TARGET_DIR}.zip" "$TARGET_DIR"
# Remove the target directory after zipping
rm -r "$TARGET_DIR"
echo "Created and zipped directory: ${TARGET_DIR}.zip"