File tree 1 file changed +15
-5
lines changed 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
diff --git a/relocate-sdk.sh b/relocate-sdk.sh
2
2
--- a/relocate-sdk.sh (date 1687254851000)
3
- +++ b/relocate-sdk.sh (date 1687703200191)
4
- @@ -43,10 +43,10 @@
3
+ +++ b/relocate-sdk.sh (date 1699325031602)
4
+ @@ -39,14 +39,20 @@
5
+
6
+ # Make sure file uses the right language
7
+ export LC_ALL=C
8
+ + # Proper in-place argument for sed
9
+ + if sed --version 1>/dev/null 2>&1; then
10
+ + SED_INPLACE_ARGS="-i"
11
+ + else # BSD sed
12
+ + SED_INPLACE_ARGS="-i ''"
13
+ + fi
14
+ # Replace the old path with the new one in all text files
5
15
grep -lr "${OLDPATH}" . | while read -r FILE ; do
6
16
if file -b --mime-type "${FILE}" | grep -q '^text/' && [ "${FILE}" != "${LOCFILE}" ]
7
17
then
8
18
- sed -i "s|${OLDPATH}|${NEWPATH}|g" "${FILE}"
9
- + sed -i "" "s|${OLDPATH}|${NEWPATH}|g" "${FILE}"
19
+ + sed ${SED_INPLACE_ARGS} "s|${OLDPATH}|${NEWPATH}|g" "${FILE}"
10
20
fi
11
21
done
12
-
22
+
13
23
# At the very end, we update the location file to not break the
14
24
# SDK if this script gets interruted.
15
25
- sed -i "s|${OLDPATH}|${NEWPATH}|g" ${LOCFILE}
16
- + sed -i "" "s|${OLDPATH}|${NEWPATH}|g" ${LOCFILE}
26
+ + sed ${SED_INPLACE_ARGS} "s|${OLDPATH}|${NEWPATH}|g" ${LOCFILE}
You can’t perform that action at this time.
0 commit comments