File tree 4 files changed +52
-12
lines changed
4 files changed +52
-12
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ # #===----------------------------------------------------------------------===##
3
+ # #
4
+ # # This source file is part of the VS Code Swift open source project
5
+ # #
6
+ # # Copyright (c) 2021 the VS Code Swift project authors
7
+ # # Licensed under Apache License v2.0
8
+ # #
9
+ # # See LICENSE.txt for license information
10
+ # # See CONTRIBUTORS.txt for the list of VS Code Swift project authors
11
+ # #
12
+ # # SPDX-License-Identifier: Apache-2.0
13
+ # #
14
+ # #===----------------------------------------------------------------------===##
15
+
2
16
sleep " $1 "
3
17
exit " $2 "
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ # #===----------------------------------------------------------------------===##
3
+ # #
4
+ # # This source file is part of the VS Code Swift open source project
5
+ # #
6
+ # # Copyright (c) 2021 the VS Code Swift project authors
7
+ # # Licensed under Apache License v2.0
8
+ # #
9
+ # # See LICENSE.txt for license information
10
+ # # See CONTRIBUTORS.txt for the list of VS Code Swift project authors
11
+ # #
12
+ # # SPDX-License-Identifier: Apache-2.0
13
+ # #
14
+ # #===----------------------------------------------------------------------===##
2
15
3
16
node << 'EOF '
4
17
const { execSync } = require('child_process');
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ # #===----------------------------------------------------------------------===##
3
+ # #
4
+ # # This source file is part of the VS Code Swift open source project
5
+ # #
6
+ # # Copyright (c) 2021 the VS Code Swift project authors
7
+ # # Licensed under Apache License v2.0
8
+ # #
9
+ # # See LICENSE.txt for license information
10
+ # # See CONTRIBUTORS.txt for the list of VS Code Swift project authors
11
+ # #
12
+ # # SPDX-License-Identifier: Apache-2.0
13
+ # #
14
+ # #===----------------------------------------------------------------------===##
15
+
2
16
set -ex
3
17
4
18
current_directory=$( pwd)
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ if [[ "$1" != "--force-run" ]]; then
25
25
fi
26
26
27
27
set -eu
28
+
29
+ original_dir=$( pwd)
30
+ cd " $( dirname " $0 " ) /.."
31
+
28
32
here=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
29
33
30
34
function replace_acceptable_years() {
81
85
;;
82
86
esac
83
87
84
- expected_lines=$( cat " $tmp " | wc -l )
85
- expected_sha=$( cat " $tmp " | shasum )
88
+ expected_lines=$( wc -l < " $tmp " )
89
+ expected_sha=$( shasum < " $tmp " )
86
90
87
91
(
88
92
cd " $here /.."
98
102
\( \! -path ' ./coverage/*' -a \
99
103
\( " ${matching_files[@]} " \) \
100
104
\) \) \) \) \) \) \) \)
101
-
102
- if [[ " $language " = bash ]]; then
103
- # add everything with a shell shebang too
104
- git grep --full-name -l ' #!/bin/bash'
105
- git grep --full-name -l ' #!/bin/sh'
106
- fi
107
- } | while read line; do
108
- if [[ " $( cat " $line " | replace_acceptable_years | head -n $expected_lines | shasum) " != " $expected_sha " ]]; then
109
- printf " \033[0;31mmissing headers in file '$line '!\033[0m\n"
110
- diff -u <( cat " $line " | replace_acceptable_years | head -n $expected_lines ) " $tmp "
105
+ } | while read -r line; do
106
+ if [[ " $( replace_acceptable_years < " $line " | head -n " $expected_lines " | shasum) " != " $expected_sha " ]]; then
107
+ printf " \033[0;31mmissing headers in file '%s'!\033[0m\n" " $line "
108
+ diff -u <( replace_acceptable_years < " $line " | head -n " $expected_lines " ) " $tmp "
111
109
exit 1
112
110
fi
113
111
done
116
114
done
117
115
118
116
rm " $tmp "
117
+ cd " $original_dir "
119
118
120
119
# printf "=> Checking for broken links in documentation... "
121
120
# find . -name node_modules -prune -o -name \*.md -print0 | xargs -0 -n1 npx markdown-link-check
You can’t perform that action at this time.
0 commit comments