Browse Source

Fix Bash Brace Expansion

It bug appeared in Debian and Trisquel
Jesús 4 months ago
parent
commit
204400b329
Signed by: Jesús <heckyel@hyperbola.info> GPG Key ID: F6EE7BC59A315766
2 changed files with 19 additions and 2 deletions
  1. 1
    2
      Makefile.example
  2. 18
    0
      scripts/vendor.sh

+ 1
- 2
Makefile.example View File

@@ -82,8 +82,7 @@ else
82 82
 endif
83 83
 
84 84
 vendor:
85
-	rm -rf output/{de,en,eo,fr}/vendor/
86
-	xargs -n 1 cp -pPR content/vendor/<<<"output/de output/en output/eo output/fr"
85
+	@bash $(BASEDIR)/scripts/vendor.sh
87 86
 
88 87
 stopserver:
89 88
 	$(BASEDIR)/develop_server.sh stop

+ 18
- 0
scripts/vendor.sh View File

@@ -0,0 +1,18 @@
1
+#!/bin/bash
2
+
3
+run_vendor()
4
+{
5
+
6
+local LOCALDIR="${2-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}"
7
+local BASE="${LOCALDIR%scripts}" # input
8
+
9
+rm -rf "$BASE"/output/{de,en,eo,fr}/vendor/
10
+
11
+echo "$BASE"output/{de,en,eo,fr} | xargs -n 1 cp -rf "$BASE"/output/vendor
12
+
13
+}
14
+
15
+# ==============================================================================
16
+# EXECUTION - START
17
+# ==============================================================================
18
+run_vendor "$@"