quoted all paths in Makefile, to prevent errors because of spaces in the working directory path

Signed-off-by: mortee <mortee@kavemalna.hu>
This commit is contained in:
mortee 2024-02-16 13:59:37 +01:00 committed by Benjamin Brahmer
parent 64709da84f
commit 1ae4a36155
1 changed files with 29 additions and 29 deletions

View File

@ -52,7 +52,7 @@ cert_dir=$(HOME)/.nextcloud/certificates
npm:=$(shell which npm 2> /dev/null)
composer:=$(shell which composer 2> /dev/null)
ifeq (,$(composer))
composer:=php $(build_tools_directory)/composer.phar
composer:=php "$(build_tools_directory)/composer.phar"
endif
#Support xDebug 3.0+
@ -74,9 +74,9 @@ build:
composer:
ifeq (, $(shell which composer 2> /dev/null))
@echo "No composer command available, downloading a copy from the web"
mkdir -p $(build_tools_directory)
mkdir -p "$(build_tools_directory)"
curl -sS https://getcomposer.org/installer | php
mv composer.phar $(build_tools_directory)
mv composer.phar "$(build_tools_directory)"
endif
$(composer) install --prefer-dist --no-dev
@ -124,9 +124,9 @@ dist:
# Builds the source package
.PHONY: source
source:
rm -rf $(source_build_directory) $(source_artifact_directory)
mkdir -p $(source_build_directory) $(source_artifact_directory)
rsync -rv . $(source_build_directory) \
rm -rf "$(source_build_directory)" "$(source_artifact_directory)"
mkdir -p "$(source_build_directory)" "$(source_artifact_directory)"
rsync -rv . "$(source_build_directory)" \
--exclude=/.git/ \
--exclude=/.idea/ \
--exclude=/build/ \
@ -137,13 +137,13 @@ ifdef CAN_SIGN
else
@echo $(sign_skip_msg)
endif
tar -cvzf $(source_package_name).tar.gz -C $(source_build_directory)/../ $(app_name)
tar -cvzf "$(source_package_name).tar.gz" -C "$(source_build_directory)/../" $(app_name)
# Builds the source package for the app store, ignores php and js tests
.PHONY: appstore
appstore:
rm -rf $(appstore_build_directory) $(appstore_sign_dir) $(appstore_artifact_directory)
install -d $(appstore_sign_dir)/$(app_name)
rm -rf "$(appstore_build_directory)" "$(appstore_sign_dir)" "$(appstore_artifact_directory)"
install -d "$(appstore_sign_dir)/$(app_name)"
cp -r \
"appinfo" \
"css" \
@ -152,44 +152,44 @@ appstore:
"lib" \
"templates" \
"vendor" \
$(appstore_sign_dir)/$(app_name)
"$(appstore_sign_dir)/$(app_name)"
# remove composer binaries, those aren't needed
rm -rf $(appstore_sign_dir)/$(app_name)/vendor/bin
rm -rf "$(appstore_sign_dir)/$(app_name)/vendor/bin"
# the App Store doesn't like .git
rm -rf $(appstore_sign_dir)/$(app_name)/vendor/arthurhoaro/favicon/.git
rm -rf "$(appstore_sign_dir)/$(app_name)/vendor/arthurhoaro/favicon/.git"
# remove large test files
rm -rf $(appstore_sign_dir)/$(app_name)/vendor/fivefilters/readability.php/test
rm -rf "$(appstore_sign_dir)/$(app_name)/vendor/fivefilters/readability.php/test"
install "COPYING" $(appstore_sign_dir)/$(app_name)
install "AUTHORS.md" $(appstore_sign_dir)/$(app_name)
install "CHANGELOG.md" $(appstore_sign_dir)/$(app_name)
install "COPYING" "$(appstore_sign_dir)/$(app_name)"
install "AUTHORS.md" "$(appstore_sign_dir)/$(app_name)"
install "CHANGELOG.md" "$(appstore_sign_dir)/$(app_name)"
#remove stray .htaccess files since they are filtered by nextcloud
find $(appstore_sign_dir) -name .htaccess -exec rm {} \;
find "$(appstore_sign_dir)" -name .htaccess -exec rm {} \;
# on macOS there is no option "--parents" for the "cp" command
mkdir -p $(appstore_sign_dir)/$(app_name)/js
cp js/* $(appstore_sign_dir)/$(app_name)/js/
mkdir -p "$(appstore_sign_dir)/$(app_name)/js"
cp js/* "$(appstore_sign_dir)/$(app_name)/js/"
# export the key and cert to a file
@if [ ! -f $(cert_dir)/$(app_name).key ] || [ ! -f $(cert_dir)/$(app_name).crt ]; then \
@if [ ! -f "$(cert_dir)/$(app_name).key" ] || [ ! -f "$(cert_dir)/$(app_name).crt" ]; then \
echo "Key and cert do not exist"; \
mkdir -p $(cert_dir); \
mkdir -p "$(cert_dir)"; \
php ./bin/tools/file_from_env.php "app_private_key" "$(cert_dir)/$(app_name).key"; \
php ./bin/tools/file_from_env.php "app_public_crt" "$(cert_dir)/$(app_name).crt"; \
fi
@if [ -f $(cert_dir)/$(app_name).key ]; then \
@if [ -f "$(cert_dir)/$(app_name).key" ]; then \
echo "Signing app files…"; \
php ../../occ integrity:sign-app \
--privateKey=$(cert_dir)/$(app_name).key\
--certificate=$(cert_dir)/$(app_name).crt\
--path=$(appstore_sign_dir)/$(app_name); \
--privateKey="$(cert_dir)/$(app_name).key"\
--certificate="$(cert_dir)/$(app_name).crt"\
--path="$(appstore_sign_dir)/$(app_name)"; \
echo "Signing app files ... done"; \
fi
mkdir -p $(appstore_artifact_directory)
tar -czf $(appstore_package_name).tar.gz -C $(appstore_sign_dir) $(app_name)
mkdir -p "$(appstore_artifact_directory)"
tar -czf "$(appstore_package_name).tar.gz" -C "$(appstore_sign_dir)" $(app_name)
.PHONY: js-test
@ -221,8 +221,8 @@ feed-test:
.PHONY: feed-server
feed-server:
php -S 127.0.0.1:8090 -t $(CURDIR)/tests/test_helper/feeds
php -S 127.0.0.1:8090 -t "$(CURDIR)/tests/test_helper/feeds"
.PHONY: nextcloud-server
nextcloud-server:
php -S 127.0.0.1:8080 -t $(CURDIR)/../../.
php -S 127.0.0.1:8080 -t "$(CURDIR)/../../."