add diff for no set -e and no cd to script dir patch
This commit is contained in:
parent
5d58c84be4
commit
bc4d76f633
2 changed files with 22 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
= Cからシェルスクリプトを呼ぶテスト
|
||||
* 作業ディレクトリが変わらないので注意
|
||||
* 適切にオプションを設定しないとエラー検知できないので注意
|
||||
|
||||
== 使い方
|
||||
`make`
|
||||
|
||||
`./noset_nocd.patch` のパッチを当てると、ちゃんとしたスクリプトになってくれる。
|
||||
|
|
17
noset_nocd.patch
Normal file
17
noset_nocd.patch
Normal file
|
@ -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"
|
Loading…
Reference in a new issue