File tree Expand file tree Collapse file tree 2 files changed +44
-4
lines changed Expand file tree Collapse file tree 2 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 4
4
. detect-environment
5
5
. compile-options
6
6
7
- if [ " $BUILD_TYPE " != " RELEASE" ]; then
7
+ if [ $BUILD_TYPE != " RELEASE" ]; then
8
8
echo " Debug symbols not requested"
9
9
exit 0
10
10
else
60
60
61
61
# Write the installation script
62
62
log_debug " Writing the installation script"
63
- cat << EOF >> $PAYLOAD_DIR /install-ds.sh
63
+ cat << EOF >>$PAYLOAD_DIR /install-ds.sh
64
64
#!/bin/sh
65
65
# Install debug symbols for executables
66
66
for i in \` ls exe/*.gz\` ; do
77
77
78
78
# Write the decompression script
79
79
log_debug " Writing the decompression script"
80
- cat << EOF >> decompress-ds.sh
80
+ cat << EOF >>decompress-ds.sh
81
81
#!/bin/sh
82
82
echo "Installing debug symbols"
83
83
TMPDIR=\` mktemp -d /tmp/ds.XXXXXX\` ; export TMPDIR
97
97
98
98
# Write the uninstall script
99
99
log_debug " Writing the uninstall script"
100
- cat << EOF >> $PAYLOAD_DIR /uninstall-ds.sh
100
+ cat << EOF >>$PAYLOAD_DIR /uninstall-ds.sh
101
101
#!/bin/sh
102
102
echo "Uninstalling debug symbols"
103
103
rm -f "$PREFIX "/bin/*.\$ DEBUG_SUFFIX
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+ #
4
+ # Interactively lint & format shell scripts in the build-scripts directory.
5
+ #
6
+ # Dependencies:
7
+ # * shfmt
8
+ # * shellcheck
9
+ #
10
+ # This script takes no arguments can be executed from anywhere, e.g.:
11
+ # $ ./user-scripts/check-scripts.sh
12
+ #
13
+
14
+ BUILD_SCRIPTS=" $( dirname " $0 " ) " /../build-scripts
15
+
16
+ grep -Erl ' ^(#!/(bin|usr/bin)/(env )?(sh|bash))' " $BUILD_SCRIPTS " | sort | while read -r filepath; do
17
+ filename=$( basename " $filepath " )
18
+
19
+ if ! shfmt --diff --indent=4 " $filepath " ; then
20
+ echo
21
+ echo " File '$filename ' requires formatting."
22
+ read -r -p " Do you wish to format '$filename '? [y/N] " answer < /dev/tty
23
+ case $answer in
24
+ [yY] | [yY][eE][sS])
25
+ echo " Formatting file '$filename '..."
26
+ shfmt --write --indent=4 " $filepath "
27
+ ;;
28
+ * )
29
+ echo " Skipping formatting of file '$filename '..."
30
+ ;;
31
+ esac
32
+ fi
33
+
34
+ if ! shellcheck --external-sources --source-path=" $BUILD_SCRIPTS " " $filepath " ; then
35
+ echo
36
+ echo " File '$filename ' requires manual intervention."
37
+ read -n 1 -s -r -p " Press any key to continue..." < /dev/tty
38
+ echo
39
+ fi
40
+ done
You can’t perform that action at this time.
0 commit comments