Skip to content

Commit

Permalink
use \#\!/usr/bin/env bash for portability
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Feb 27, 2024
1 parent a6e2521 commit 61ca9b0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ $(TEST_TARGET): $(MXENV_TARGET)

.PHONY: test
test: $(FILES_TARGET) $(SOURCES_TARGET) $(PACKAGES_TARGET) $(TEST_TARGET) $(TEST_DEPENDENCY_TARGETS)
@echo "Run tests"
@test -z "$(TEST_COMMAND)" && echo "No test command defined"
@test -z "$(TEST_COMMAND)" || bash -c "$(TEST_COMMAND)"
@test -z "$(TEST_COMMAND)" && echo "No test command defined" && exit 1 || :
@echo "Run tests using $(TEST_COMMAND)"
@/usr/bin/env bash -c "$(TEST_COMMAND)"

.PHONY: test-dirty
test-dirty:
Expand Down
2 changes: 1 addition & 1 deletion src/mxmake/templates/script.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# THIS SCRIPT IS GENERATED BY MXMAKE.
# CHANGES MADE IN THIS FILE WILL BE LOST.
Expand Down
12 changes: 6 additions & 6 deletions src/mxmake/tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_TestScript(self, tempdir):
with open(os.path.join(tempdir, "run-tests.sh")) as f:
self.checkOutput(
"""
#!/bin/bash
#!/usr/bin/env bash
#
# THIS SCRIPT IS GENERATED BY MXMAKE.
# CHANGES MADE IN THIS FILE WILL BE LOST.
Expand Down Expand Up @@ -205,7 +205,7 @@ def test_TestScript(self, tempdir):
with open(os.path.join(tempdir, "run-tests.sh")) as f:
self.checkOutput(
"""
#!/bin/bash
#!/usr/bin/env bash
#
# THIS SCRIPT IS GENERATED BY MXMAKE.
# CHANGES MADE IN THIS FILE WILL BE LOST.
Expand Down Expand Up @@ -237,7 +237,7 @@ def test_TestScript(self, tempdir):
with open(os.path.join(tempdir, "run-tests.sh")) as f:
self.checkOutput(
"""
#!/bin/bash
#!/usr/bin/env bash
#
# THIS SCRIPT IS GENERATED BY MXMAKE.
# CHANGES MADE IN THIS FILE WILL BE LOST.
Expand Down Expand Up @@ -324,7 +324,7 @@ def test_CoverageScript(self, tempdir):
with open(os.path.join(tempdir, "run-coverage.sh")) as f:
self.checkOutput(
"""
#!/bin/bash
#!/usr/bin/env bash
#
# THIS SCRIPT IS GENERATED BY MXMAKE.
# CHANGES MADE IN THIS FILE WILL BE LOST.
Expand Down Expand Up @@ -391,7 +391,7 @@ def test_CoverageScript(self, tempdir):
with open(os.path.join(tempdir, "run-coverage.sh")) as f:
self.checkOutput(
"""
#!/bin/bash
#!/usr/bin/env bash
#
# THIS SCRIPT IS GENERATED BY MXMAKE.
# CHANGES MADE IN THIS FILE WILL BE LOST.
Expand Down Expand Up @@ -436,7 +436,7 @@ def test_CoverageScript(self, tempdir):
with open(os.path.join(tempdir, "run-coverage.sh")) as f:
self.checkOutput(
"""
#!/bin/bash
#!/usr/bin/env bash
#
# THIS SCRIPT IS GENERATED BY MXMAKE.
# CHANGES MADE IN THIS FILE WILL BE LOST.
Expand Down
6 changes: 3 additions & 3 deletions src/mxmake/topics/qa/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ $(TEST_TARGET): $(MXENV_TARGET)

.PHONY: test
test: $(FILES_TARGET) $(SOURCES_TARGET) $(PACKAGES_TARGET) $(TEST_TARGET) $(TEST_DEPENDENCY_TARGETS)
@echo "Run tests"
@test -z "$(TEST_COMMAND)" && echo "No test command defined"
@test -z "$(TEST_COMMAND)" || bash -c "$(TEST_COMMAND)"
@test -z "$(TEST_COMMAND)" && echo "No test command defined" && exit 1 || :
@echo "Run tests using $(TEST_COMMAND)"
@/usr/bin/env bash -c "$(TEST_COMMAND)"

.PHONY: test-dirty
test-dirty:
Expand Down

0 comments on commit 61ca9b0

Please sign in to comment.