Skip to content

Commit 5b8f395

Browse files
committed
change bash command to multiple lines
1 parent 0ce9f9d commit 5b8f395

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

Ellabit/Ellabit.csproj

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,26 @@
112112

113113
<!-- Linux / macOS version -->
114114
<Exec Condition="'$(OS)' != 'Windows_NT'"
115-
Command='bash -c "frameworkDir=$(PublishRootDir)/wwwroot/_framework; echo [ > $frameworkDir/framework_manifest.json; first=true; for dll in $frameworkDir/*.dll; do if [ $first = true ]; then first=false; else echo , >> $frameworkDir/framework_manifest.json; fi; filename=${dll##*/}; name=${filename%%.*}; echo { \\"Name\\": \\"$name\\", \\"File\\": \\"$filename\\" } >> $frameworkDir/framework_manifest.json; done; echo ] >> $frameworkDir/framework_manifest.json"' />
116-
115+
Command='bash -c "
116+
set -e;
117+
frameworkDir=$(PublishRootDir)/wwwroot/_framework;
118+
mkdir -p $frameworkDir; # ensures folder exists
119+
shopt -s nullglob; # prevents errors if no DLLs
120+
jsonFile=$frameworkDir/framework_manifest.json;
121+
echo [ > $jsonFile;
122+
first=true;
123+
for dll in $frameworkDir/*.dll; do
124+
filename=${dll##*/};
125+
name=${filename%%.*};
126+
if [ $first = true ]; then
127+
first=false;
128+
else
129+
echo , >> $jsonFile;
130+
fi;
131+
echo { \\"Name\\": \\"$name\\", \\"File\\": \\"$filename\\" } >> $jsonFile;
132+
done;
133+
echo ] >> $jsonFile
134+
"' />
117135
</Target>
118136
<ItemGroup>
119137
<EmbeddedResource Include="framework_manifest.json" />

0 commit comments

Comments
 (0)