File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1515
1616cd " $( dirname " $0 " ) "
1717
18+ # Detect OS for sed syntax
19+ if [[ " $OSTYPE " == " darwin" * ]]; then
20+ SED_INPLACE=" sed -i ''"
21+ else
22+ SED_INPLACE=" sed -i"
23+ fi
24+
1825if test -z " $1 " ; then
1926 echo " Must specify the project file to process."
2027 exit 1
@@ -104,12 +111,12 @@ for proj in $(sort "$REFERENCES_PATH" | uniq); do
104111
105112 # The output contains relative paths, relative to the csproj directory
106113 # Change those to full paths by prepending the csproj directory.
107- sed -i ' ' " s@^@$proj_dir /@" " $inputs_path "
114+ $SED_INPLACE " s@^@$proj_dir /@" " $inputs_path "
108115
109116 # Change to Make syntax. This is horrifically difficult in MSBuild,
110117 # because MSBuild blindly replaces backslashes with forward slashes (i.e.
111118 # windows paths to unix paths...)
112- sed -i ' ' " s_^\\ (.*\\ )\$ _ \\ 1 \\\\ _" " $inputs_path "
119+ $SED_INPLACE " s_^\\ (.*\\ )\$ _ \\ 1 \\\\ _" " $inputs_path "
113120
114121 # Clean up
115122 rm -f " $TMPPROJ "
@@ -125,7 +132,7 @@ sort "${INPUT_PATHS[@]}" | uniq >> "$FRAGMENT_PATH"
125132
126133# Simplify paths somewhat by removing the current directory
127134if test -z " $ABSOLUTE_PATHS " ; then
128- sed -i ' ' " s@$PROJECT_DIR /@@" " $FRAGMENT_PATH "
135+ $SED_INPLACE " s@$PROJECT_DIR /@@" " $FRAGMENT_PATH "
129136fi
130137
131138# Cleanup
You can’t perform that action at this time.
0 commit comments