|
1 | 1 | import * as debugModule from 'debug'; |
2 | | -import * as errors from '../../errors'; |
3 | 2 | import { CliCommandError } from '../../errors'; |
4 | 3 | import * as path from 'path'; |
5 | 4 | import * as subprocess from './subprocess'; |
@@ -51,36 +50,18 @@ export async function validate(): Promise<string> { |
51 | 50 | } |
52 | 51 | } |
53 | 52 |
|
54 | | -export async function restore(projectPath: string): Promise<string> { |
| 53 | +export async function restore(projectPath: string): Promise<void> { |
55 | 54 | const command = 'dotnet'; |
56 | 55 | const args = [ |
57 | 56 | 'restore', |
58 | 57 | // Get a larger amount of debugging information to stdout in case something fails. |
59 | 58 | // Useful for customers to attempt self-debugging before raising support requests. |
60 | 59 | '--verbosity', |
61 | 60 | 'normal', |
62 | | - projectPath, |
| 61 | + `"${projectPath}"`, |
63 | 62 | ]; |
64 | | - const result = await handle('restore', command, args); |
65 | | - |
66 | | - // A customer can define a <BaseOutPutPath> that redirects where `dotnet` saves the assets file. This will |
67 | | - // get picked up by the dotnet tool and reported in the output logs. |
68 | | - const regex = /Path:\s+(\S+project.assets.json)/g; |
69 | | - const matches = result.stdout.matchAll(regex); |
70 | | - |
71 | | - const manifestFiles: string[] = []; |
72 | | - for (const match of matches) { |
73 | | - manifestFiles.push(match[1]); |
74 | | - } |
75 | | - |
76 | | - if (manifestFiles.length === 0) { |
77 | | - throw new errors.FileNotProcessableError( |
78 | | - 'found no information in stdout about the whereabouts of the assets file', |
79 | | - ); |
80 | | - } |
81 | | - |
82 | | - // Return the last element in the log, as it might be mentioning local asset files in reverse order. |
83 | | - return manifestFiles[manifestFiles.length - 1]; |
| 63 | + await handle('restore', command, args); |
| 64 | + return; |
84 | 65 | } |
85 | 66 |
|
86 | 67 | export async function run( |
@@ -128,7 +109,7 @@ export async function publish( |
128 | 109 |
|
129 | 110 | // The path that contains either some form of project file, or a .sln one. |
130 | 111 | // See: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish#arguments |
131 | | - args.push(projectPath); |
| 112 | + args.push(`"${projectPath}"`); |
132 | 113 |
|
133 | 114 | await handle('publish', command, args); |
134 | 115 |
|
|
0 commit comments