Skip to content

Commit fc2b12e

Browse files
authored
Revert to using relative paths (#334)
Otherwise the zip file contains the entire absolute path structure
1 parent 94e5b8a commit fc2b12e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

scripts/prepare-release.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,16 @@ echo -e "${YELLOW}Preparing release artifacts...${NC}"
3636
create_zip() {
3737
local source_dir="$1"
3838
local zip_name="$2"
39-
local full_path="$FONTS_DIR/$source_dir"
39+
local parent_dir="${3:-$FONTS_DIR}"
40+
local full_path="$parent_dir/$source_dir"
4041

4142
if [ -d "$full_path" ]; then
4243
echo " Creating $zip_name from $full_path"
43-
zip -r "$OUTPUT_DIR/$zip_name" "$(pwd)/$full_path" > /dev/null
44+
if [ "$parent_dir" = "$FONTS_DIR" ]; then
45+
(cd "$parent_dir" && zip -r "../$OUTPUT_DIR/$zip_name" "$source_dir") > /dev/null
46+
else
47+
(cd "$parent_dir" && zip -r "../../$OUTPUT_DIR/$zip_name" "$source_dir") > /dev/null
48+
fi
4449

4550
# Get file count and size
4651
local file_count=$(find "$full_path" -type f | wc -l | tr -d ' ')
@@ -61,10 +66,10 @@ create_zip "NerdFonts" "monaspace-nerdfonts-v${VERSION}.zip"
6166
if [ -d "$FONTS_DIR/Web Fonts" ]; then
6267
echo -e "${YELLOW}Processing web fonts...${NC}"
6368

64-
# Now create zips from within Web Fonts directory
65-
create_zip "Web Fonts/NerdFonts Web Fonts" "monaspace-webfont-nerdfonts-v${VERSION}.zip"
66-
create_zip "Web Fonts/Static Web Fonts" "monaspace-webfont-static-v${VERSION}.zip"
67-
create_zip "Web Fonts/Variable Web Fonts" "monaspace-webfont-variable-v${VERSION}.zip"
69+
# Create zips from within Web Fonts directory
70+
create_zip "NerdFonts Web Fonts" "monaspace-webfont-nerdfonts-v${VERSION}.zip" "$FONTS_DIR/Web Fonts"
71+
create_zip "Static Web Fonts" "monaspace-webfont-static-v${VERSION}.zip" "$FONTS_DIR/Web Fonts"
72+
create_zip "Variable Web Fonts" "monaspace-webfont-variable-v${VERSION}.zip" "$FONTS_DIR/Web Fonts"
6873
else
6974
echo -e "${RED}Warning: Web Fonts directory not found${NC}"
7075
fi

0 commit comments

Comments
 (0)