File tree Expand file tree Collapse file tree 4 files changed +52
-6
lines changed Expand file tree Collapse file tree 4 files changed +52
-6
lines changed Original file line number Diff line number Diff line change 11#! /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+
216sleep " $1 "
317exit " $2 "
Original file line number Diff line number Diff line change 11#! /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+ # #===----------------------------------------------------------------------===##
215
316node << 'EOF '
417const { execSync } = require('child_process');
Original file line number Diff line number Diff line change 11#! /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+
216set -ex
317
418current_directory=$( pwd)
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ if [[ "$1" != "--force-run" ]]; then
2525fi
2626
2727set -eu
28+
29+ original_dir=$( pwd)
30+ cd " $( dirname " $0 " ) /.."
31+
2832here=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
2933
3034function replace_acceptable_years() {
8185 ;;
8286 esac
8387
84- expected_lines=$( cat " $tmp " | wc -l )
85- expected_sha=$( cat " $tmp " | shasum )
88+ expected_lines=$( wc -l < " $tmp " )
89+ expected_sha=$( shasum < " $tmp " )
8690
8791 (
8892 cd " $here /.."
@@ -104,10 +108,10 @@ EOF
104108 git grep --full-name -l ' #!/bin/bash'
105109 git grep --full-name -l ' #!/bin/sh'
106110 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 "
111+ } | while read -r line; do
112+ if [[ " $( replace_acceptable_years < " $line " | head -n " $expected_lines " | shasum) " != " $expected_sha " ]]; then
113+ printf " \033[0;31mmissing headers in file '%s '!\033[0m\n" " $line "
114+ diff -u <( replace_acceptable_years < " $line " | head -n " $expected_lines " ) " $tmp "
111115 exit 1
112116 fi
113117 done
116120done
117121
118122rm " $tmp "
123+ cd " $original_dir "
119124
120125# printf "=> Checking for broken links in documentation... "
121126# 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