Skip to content

Commit 634e5a1

Browse files
committed
Refs #25328 Use a portable shebang
BSD systems don't place bash in /bin and a lot of the dart tools hardcode a #!/bin/bash shebang that fails the 'all' target build (not able to execute dart2js since the interpreter is not found). Solve the issue by using #!/usr/bin/env as the shebang. For scripts that need to pass arguments to bash modify the script to use the set command as the first executed line of shell. BUG= [email protected] Review URL: https://codereview.chromium.org/1552313002 .
1 parent 3260f35 commit 634e5a1

29 files changed

+40
-29
lines changed

pkg/analysis_server/tool/spec/generate_files

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

pkg/analyzer/tool/generate_files

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

runtime/tools/bmu_benchmark_gallery.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
44
# for details. All rights reserved. Use of this source code is governed by a

sdk/bin/dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dart2js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dart2js_developer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dart2js_sdk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dartanalyzer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dartanalyzer_developer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dartanalyzer_sdk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dartdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dartfmt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/dartfmt_sdk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/pub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

sdk/bin/pub_sdk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

site/try/create_manifest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

tests/standalone/io/create_sample_certificates.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
ssh -i $SSH_KEY_PATH $@

tools/apps/update_homebrew/bin/update_homebrew.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class Dart < Formula
186186
187187
def shim_script target
188188
<<-EOS.undent
189-
#!/bin/bash
189+
#!/usr/bin/env bash
190190
exec "#{prefix}/#{target}" "\$@"
191191
EOS
192192
end

tools/bots/run_android_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

tools/create_debian_chroot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
44
# for details. All rights reserved. Use of this source code is governed by a

tools/dartium/download_shellscript_template.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

tools/dartium/start_dartium_roll.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/bin/bash -e
1+
#!/usr/bin/env bash
2+
3+
set -e
24

35
# Requirements:
46
# sudo apt-get install xclip

tools/dom/scripts/go.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
#!/bin/bash -x
1+
#!/usr/bin/env bash
22
#
3+
4+
set -x
5+
36
# go.sh [systems]
47
#
58
# Convenience script to generate systems. Do not call from build steps or tests

tools/precompilation/test_linux.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/bin/bash -ex
1+
#!/usr/bin/env bash
2+
3+
set -ex
24

35
# Usage:
46
# cd sdk

tools/precompilation/test_linux_simarm.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/bin/bash -ex
1+
#!/usr/bin/env bash
2+
3+
set -ex
24

35
# Usage:
46
# cd sdk

tools/precompilation/test_macos.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#!/bin/bash -ex
1+
#!/usr/bin/env bash
2+
3+
set -ex
24

35
# Usage:
46
# cd sdk

tools/presubmit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
#
33
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
44
# for details. All rights reserved. Use of this source code is governed by a

tools/testing/bin/jsshell

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
33
# for details. All rights reserved. Use of this source code is governed by a
44
# BSD-style license that can be found in the LICENSE file.

0 commit comments

Comments
 (0)