From bc4d76f6339c005934ef9bb930cba35452c1dab7 Mon Sep 17 00:00:00 2001 From: qwjyh Date: Thu, 10 Oct 2024 21:00:49 +0900 Subject: [PATCH] add diff for no set -e and no cd to script dir patch --- README.adoc | 5 +++++ noset_nocd.patch | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 noset_nocd.patch diff --git a/README.adoc b/README.adoc index 1a79888..f6888a2 100644 --- a/README.adoc +++ b/README.adoc @@ -1,3 +1,8 @@ = Cからシェルスクリプトを呼ぶテスト * 作業ディレクトリが変わらないので注意 * 適切にオプションを設定しないとエラー検知できないので注意 + +== 使い方 +`make` + +`./noset_nocd.patch` のパッチを当てると、ちゃんとしたスクリプトになってくれる。 diff --git a/noset_nocd.patch b/noset_nocd.patch new file mode 100644 index 0000000..4ce64fe --- /dev/null +++ b/noset_nocd.patch @@ -0,0 +1,17 @@ +diff --git a/subdir/entry.sh b/subdir/entry.sh +index 4e7b013..b070a09 100755 +--- a/subdir/entry.sh ++++ b/subdir/entry.sh +@@ -1,10 +1,10 @@ + #!/bin/env bash +-set -euo pipefail ++# set -euo pipefail + echo "Hi, this is entry.sh" + echo "pwd:" + pwd + echo "\${0}: ${0}" +-cd "$(dirname "${0}")" ++# cd "$(dirname "${0}")" + ./called.sh + echo $? + echo "returned"