Skip to content

Commit 7b8de35

Browse files
committed
fix: handle paths containing spaces in Makefiles
1 parent f4940b9 commit 7b8de35

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

‎Makefile‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ PROJECT=tcpdf
2626
VERSION=$(shell sed -E 's/\\n$$//' VERSION | tr -d '\r\n')
2727

2828
# Current directory
29-
CURRENTDIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
29+
CURRENTDIR=$(CURDIR)/
3030

3131
# Target directory
32-
TARGETDIR=$(CURRENTDIR)target
32+
TARGETDIR=target
3333

3434
# sed argument for in-place substitutions
3535
SEDINPLACE=-i
@@ -84,7 +84,7 @@ buildall: deps
8484
## Delete vendor and generated directories
8585
.PHONY: clean
8686
clean:
87-
rm -rf ./vendor ./tests/vendor $(TARGETDIR) ./build ./cache
87+
rm -rf ./vendor ./tests/vendor "$(TARGETDIR)" ./build ./cache
8888

8989
## Clean all artifacts and download all dependencies
9090
.PHONY: deps
@@ -96,29 +96,29 @@ deps: ensuretarget
9696
## Initialize tc-lib-pdf font assets if needed
9797
.PHONY: fonts
9898
fonts:
99-
@if [ ! -d $(TCPDF_FONT_PKGDIR) ]; then \
99+
@if [ ! -d "$(TCPDF_FONT_PKGDIR)" ]; then \
100100
echo "tc-lib-pdf-font is not installed. Run composer install first."; \
101101
exit 1; \
102102
fi
103-
@if [ -f $(TCPDF_FONT_SENTINEL) ]; then \
103+
@if [ -f "$(TCPDF_FONT_SENTINEL)" ]; then \
104104
echo "tc-lib-pdf font assets already initialized."; \
105105
else \
106106
echo "Initializing tc-lib-pdf font assets..."; \
107-
$(MAKE) -C $(TCPDF_FONT_PKGDIR) clean; \
108-
$(COMPOSER) --working-dir=$(TCPDF_FONT_PKGDIR) install --no-interaction; \
109-
$(MAKE) -C $(TCPDF_FONT_PKGDIR) fonts; \
107+
$(MAKE) -C "$(TCPDF_FONT_PKGDIR)" clean; \
108+
$(COMPOSER) --working-dir="$(TCPDF_FONT_PKGDIR)" install --no-interaction; \
109+
$(MAKE) -C "$(TCPDF_FONT_PKGDIR)" fonts; \
110110
fi
111111

112112
## Rebuild tc-lib-pdf font assets from scratch
113113
.PHONY: fonts-rebuild
114114
fonts-rebuild:
115-
@if [ ! -d $(TCPDF_FONT_PKGDIR) ]; then \
115+
@if [ ! -d "$(TCPDF_FONT_PKGDIR)" ]; then \
116116
echo "tc-lib-pdf-font is not installed. Run composer install first."; \
117117
exit 1; \
118118
fi
119-
$(MAKE) -C $(TCPDF_FONT_PKGDIR) clean
120-
$(COMPOSER) --working-dir=$(TCPDF_FONT_PKGDIR) install --no-interaction
121-
$(MAKE) -C $(TCPDF_FONT_PKGDIR) fonts
119+
$(MAKE) -C "$(TCPDF_FONT_PKGDIR)" clean
120+
$(COMPOSER) --working-dir="$(TCPDF_FONT_PKGDIR)" install --no-interaction
121+
$(MAKE) -C "$(TCPDF_FONT_PKGDIR)" fonts
122122

123123
## Generate source code documentation with Doctum if available
124124
.PHONY: doc
@@ -133,9 +133,9 @@ doc:
133133
## Create missing target directories for test and build artifacts
134134
.PHONY: ensuretarget
135135
ensuretarget:
136-
mkdir -p $(TARGETDIR)/test
137-
mkdir -p $(TARGETDIR)/report
138-
mkdir -p $(TARGETDIR)/doc
136+
mkdir -p "$(TARGETDIR)/test"
137+
mkdir -p "$(TARGETDIR)/report"
138+
mkdir -p "$(TARGETDIR)/doc"
139139

140140
## Format the source code
141141
.PHONY: format

‎VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.0.3
1+
7.0.4

‎tcpdf.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
//============================================================+
44
// File name : tcpdf.php
5-
// Version : 7.0.3
5+
// Version : 7.0.4
66
// Author : Nicola Asuni - Tecnick.com LTD - www.tecnick.com - info@tecnick.com
77
// License : GNU-LGPL v3 (https://www.gnu.org/copyleft/lesser.html)
88
// Copyright (C): 2002-2026 Nicola Asuni - Tecnick.com LTD
@@ -15,7 +15,7 @@
1515
* See: https://tcpdf.org
1616
* @package com.tecnick.tcpdf
1717
* @author Nicola Asuni
18-
* @version 7.0.3
18+
* @version 7.0.4
1919
*/
2020

2121
// TCPDF configuration

0 commit comments

Comments
 (0)