Skip to content

Commit

Permalink
Ensure bash shebang lines are portable (#53)
Browse files Browse the repository at this point in the history
This commit ensures all instances of bash shebang line are utilizing portable '/usr/bin/env bash', allowing for greater portability of the rules_gitops
  • Loading branch information
AleksanderGondek authored Jan 29, 2021
1 parent ba88e12 commit 285af1c
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion create_kind_cluster.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
Expand Down
2 changes: 1 addition & 1 deletion e2e_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
Expand Down
2 changes: 1 addition & 1 deletion examples/e2e-test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld/k8s_deploy_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# Debug
# set -x
Expand Down
2 changes: 1 addition & 1 deletion skylib/cmd.sh.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
Expand Down
2 changes: 1 addition & 1 deletion skylib/k8s.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _python_runfiles(ctx, f):
return "PYTHON_RUNFILES=${RUNFILES} %s" % _runfiles(ctx, f)

def _show_impl(ctx):
script_content = "#!/bin/bash\nset -e\n"
script_content = "#!/usr/bin/env bash\nset -e\n"

kustomize_outputs = []
script_template = "{template_engine} --template={infile} --variable=NAMESPACE={namespace} --stamp_info_file={info_file}\n"
Expand Down
2 changes: 1 addition & 1 deletion skylib/k8s_cmd.sh.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
Expand Down
2 changes: 1 addition & 1 deletion skylib/k8s_gitops.sh.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
Expand Down
2 changes: 1 addition & 1 deletion skylib/k8s_test_namespace.sh.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
Expand Down
2 changes: 1 addition & 1 deletion skylib/kustomize/kustomize.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _is_ignored_src(src):
return basename.startswith(".")

_script_template = """\
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail
{kustomize} build --load_restrictor none --reorder legacy {kustomize_dir} {template_part} {resolver_part} >{out}
"""
Expand Down
2 changes: 1 addition & 1 deletion skylib/kustomize/run-all.sh.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
4 changes: 3 additions & 1 deletion skylib/kustomize/set_namespace.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash +x
#!/usr/bin/env bash
# Copyright 2020 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
Expand All @@ -9,6 +9,8 @@
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.

set +x

if [ "$1" == "" ]; then
echo usage:
echo $0 'namespace <in.yaml >out.yaml'
Expand Down
2 changes: 1 addition & 1 deletion skylib/kustomize/tests/set_namespace_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail

function test_namespace_replaced {
Expand Down
2 changes: 1 addition & 1 deletion skylib/tests/fork_join_test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -euo pipefail

function test_dedupe {
Expand Down

0 comments on commit 285af1c

Please sign in to comment.