-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·41 lines (33 loc) · 882 Bytes
/
package.sh
File metadata and controls
executable file
·41 lines (33 loc) · 882 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
39
40
41
#!/bin/bash
# Read extension name and version from manifest.json
name=$(grep '"name"' manifest.json | head -n 1 | cut -d '"' -f 4 | sed 's/__MSG_extensionName__//g')
name="DeepShare"
version=$(grep '"version"' manifest.json | head -n 1 | cut -d '"' -f 4)
zip_file="${name}-${version}.zip"
build_dir="build"
# Files and directories to be included in the package
include_files=(
"_locales"
"background.js"
"icons"
"lib"
"onboarding"
"manifest.json"
"popup"
"scripts"
"styles"
)
# Clean up previous build
rm -rf "$build_dir"
rm -f "$zip_file"
# Create build directory
mkdir -p "$build_dir"
# Copy files to build directory
for item in "${include_files[@]}"; do
cp -r "$item" "$build_dir/"
done
# Create zip file
(cd "$build_dir" && zip -r "../$zip_file" .)
# Clean up build directory
rm -rf "$build_dir"
echo "Package created: $zip_file"