Skip to content

Commit d0c71ed

Browse files
authored
Correct <Exec /> commands on Windows to handle spaces in root path (#18285)
- #15055 - add a few more quotation marks
1 parent 761dc53 commit d0c71ed

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

eng/targets/Npm.Common.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<Copy SourceFiles="$(PackageJson)" DestinationFiles="$(_BackupPackageJson)" />
102102

103103
<Yarn Command="version --no-git-tag-version --new-version $(PackageVersion)" />
104-
<Exec Command="node $(MSBuildThisFileDirectory)..\scripts\update-packagejson-links.js $(PackageJson) $(PackageVersion)" />
104+
<Exec Command="node &quot;$(MSBuildThisFileDirectory)..\scripts\update-packagejson-links.js&quot; &quot;$(PackageJson)&quot; $(PackageVersion)" />
105105
<Yarn Command="pack --filename $(PackageFileName)" />
106106

107107
<Move SourceFiles="$(_PackageTargetPath)" DestinationFolder="$(PackageOutputPath)" />

src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
195195
Condition="'$(IsPackable)' == 'true'">
196196
<PropertyGroup>
197197
<_TarCommand>tar</_TarCommand>
198-
<_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">$(RepoRoot).tools\tar.exe</_TarCommand>
198+
<_TarCommand Condition="Exists('$(RepoRoot).tools\tar.exe')">"$(RepoRoot).tools\tar.exe"</_TarCommand>
199199

200200
<!-- For the tar packed with git, transform e.g. "C:\root\AspNetCore\File.tar.gz" to "/C/root/AspNetCore/File.tar.gz". -->
201201
<_TarArchiveOutputPath>$(TarArchiveOutputPath)</_TarArchiveOutputPath>
@@ -209,8 +209,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
209209
Overwrite="true" />
210210

211211
<!-- Requires Windows 10 version 1803 or newer -->
212-
<Message Importance="High" Text="Executing: $(_TarCommand) -czf $(_TarArchiveOutputPath) ." />
213-
<Exec Command="$(_TarCommand) -czf $(_TarArchiveOutputPath) ."
212+
<Message Importance="High" Text="Executing: $(_TarCommand) -czf &quot;$(_TarArchiveOutputPath)&quot; ." />
213+
<Exec Command="$(_TarCommand) -czf &quot;$(_TarArchiveOutputPath)&quot; ."
214214
WorkingDirectory="$(TargetingPackLayoutRoot)" />
215215

216216
<Message Importance="High" Text="$(MSBuildProjectName) -> $(TarArchiveOutputPath)" />

0 commit comments

Comments
 (0)