Skip to content

Commit 2b818a4

Browse files
committed
create a script for macos
1 parent 88578af commit 2b818a4

File tree

2 files changed

+55
-54
lines changed

2 files changed

+55
-54
lines changed

MODULE.bazel.lock

Lines changed: 11 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/bash
22

3+
# Check if running from repository root
4+
if [ ! -f "MODULE.bazel" ]; then
5+
echo "Error: This script must be run from the repository root directory"
6+
echo "Expected file MODULE.bazel not found in current directory"
7+
exit 1
8+
fi
9+
310
# Check if version parameter is provided
411
if [ -z "$1" ]; then
512
echo "Usage: $0 <version>"
@@ -10,11 +17,42 @@ fi
1017
version="$1"
1118
tarball_name="openapi-generator-bazel-v${version}.tar.gz"
1219

13-
# Create tarball excluding git files, bazel-* symlinks, and other unwanted files
14-
tar -czf "$tarball_name" \
15-
--exclude='.git*' \
16-
--exclude='bazel-*' \
17-
--exclude='*.tar.gz' \
18-
.
20+
# Create tarball with specific files in a subdirectory
21+
temp_dir="openapi-generator-bazel-${version}"
22+
mkdir -p "$temp_dir/internal/test/bcr"
23+
24+
# Copy files to temp directory
25+
cp BUILD.bazel "$temp_dir/"
26+
cp LICENSE "$temp_dir/"
27+
cp MODULE.bazel "$temp_dir/"
28+
cp MODULE.bazel.lock "$temp_dir/"
29+
cp defs.bzl "$temp_dir/"
30+
cp extension.bzl "$temp_dir/"
31+
cp internal/openapi_generator.bzl "$temp_dir/internal/"
32+
cp internal/BUILD.bazel "$temp_dir/internal/"
33+
cp internal/test/bcr/petstore.yaml "$temp_dir/internal/test/bcr/"
34+
cp internal/test/bcr/config.yaml "$temp_dir/internal/test/bcr/"
35+
cp internal/test/bcr/BUILD "$temp_dir/internal/test/bcr/"
36+
cp internal/test/bcr/MODULE.bazel.lock "$temp_dir/internal/test/bcr/"
37+
cp internal/test/bcr/MODULE.bazel "$temp_dir/internal/test/bcr/"
38+
39+
# Create tarball from temp directory (list files explicitly to avoid intermediate directories)
40+
tar czf "$tarball_name" -C . \
41+
"$temp_dir/BUILD.bazel" \
42+
"$temp_dir/LICENSE" \
43+
"$temp_dir/MODULE.bazel" \
44+
"$temp_dir/MODULE.bazel.lock" \
45+
"$temp_dir/defs.bzl" \
46+
"$temp_dir/extension.bzl" \
47+
"$temp_dir/internal/openapi_generator.bzl" \
48+
"$temp_dir/internal/BUILD.bazel" \
49+
"$temp_dir/internal/test/bcr/petstore.yaml" \
50+
"$temp_dir/internal/test/bcr/config.yaml" \
51+
"$temp_dir/internal/test/bcr/BUILD" \
52+
"$temp_dir/internal/test/bcr/MODULE.bazel.lock" \
53+
"$temp_dir/internal/test/bcr/MODULE.bazel"
54+
55+
# Clean up temp directory
56+
rm -rf "$temp_dir"
1957

2058
echo "Created tarball: $tarball_name"

0 commit comments

Comments
 (0)