From 204400b3298218ee21bfbe0d9d6707be75030005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Mon, 25 Feb 2019 12:52:25 -0500 Subject: [PATCH] Fix Bash Brace Expansion It bug appeared in Debian and Trisquel --- Makefile.example | 3 +-- scripts/vendor.sh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 scripts/vendor.sh diff --git a/Makefile.example b/Makefile.example index 3aeec53..43b1fda 100644 --- a/Makefile.example +++ b/Makefile.example @@ -82,8 +82,7 @@ else endif vendor: - rm -rf output/{de,en,eo,fr}/vendor/ - xargs -n 1 cp -pPR content/vendor/<<<"output/de output/en output/eo output/fr" + @bash $(BASEDIR)/scripts/vendor.sh stopserver: $(BASEDIR)/develop_server.sh stop diff --git a/scripts/vendor.sh b/scripts/vendor.sh new file mode 100644 index 0000000..1344814 --- /dev/null +++ b/scripts/vendor.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +run_vendor() +{ + +local LOCALDIR="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" +local BASE="${LOCALDIR%scripts}" # input + +rm -rf "$BASE"/output/{de,en,eo,fr}/vendor/ + +echo "$BASE"output/{de,en,eo,fr} | xargs -n 1 cp -rf "$BASE"/output/vendor + +} + +# ============================================================================== +# EXECUTION - START +# ============================================================================== +run_vendor "$@"