@@ -284,49 +284,32 @@ async function prepareRemoteRequest(
284284 } ) ;
285285
286286 if ( req . command !== 'install' && req . command !== 'reinstall' ) return baseResult ( ) ;
287- const installPackageResult = await prepareRemoteInstallPackage (
288- req ,
289- info ,
290- positionals ,
291- flags ,
292- clientArtifactPaths ,
293- ) ;
294- if ( installPackageResult ?. prepared ) return installPackageResult . prepared ;
295- uploadedArtifactId = installPackageResult ?. uploadedArtifactId ?? uploadedArtifactId ;
287+ const installPackageResult = await prepareRemoteInstallPackage ( req , info , positionals ) ;
288+ uploadedArtifactId = installPackageResult ?? uploadedArtifactId ;
296289 return baseResult ( ) ;
297290}
298291
299- type RemoteInstallPackageResult = {
300- prepared ?: PreparedRemoteRequest ;
301- uploadedArtifactId ?: string ;
302- } ;
303-
304292async function prepareRemoteInstallPackage (
305293 req : Omit < DaemonRequest , 'token' > ,
306294 info : DaemonInfo ,
307295 positionals : string [ ] ,
308- flags : DaemonRequest [ 'flags' ] | undefined ,
309- clientArtifactPaths : Record < string , string > ,
310- ) : Promise < RemoteInstallPackageResult | null > {
296+ ) : Promise < string | undefined > {
311297 const rawPath = positionals [ 1 ] ;
312- if ( rawPath === undefined ) return null ;
298+ if ( rawPath === undefined ) return undefined ;
313299 if ( rawPath . startsWith ( 'remote:' ) ) {
314300 positionals [ 1 ] = rawPath . slice ( 'remote:' . length ) ;
315- return { prepared : createPreparedRemoteRequest ( { positionals , flags , clientArtifactPaths } ) } ;
301+ return undefined ;
316302 }
317303
318304 const localPath = resolveLocalInstallPath ( rawPath , req . meta ?. cwd ) ;
319- if ( ! localPath ) {
320- return { prepared : createPreparedRemoteRequest ( { positionals, flags, clientArtifactPaths } ) } ;
321- }
305+ if ( ! localPath ) return undefined ;
322306
323- const uploadedArtifactId = await uploadArtifact ( {
307+ return await uploadArtifact ( {
324308 localPath,
325309 baseUrl : info . baseUrl ! ,
326310 token : info . token ,
327311 platform : req . flags ?. platform ,
328312 } ) ;
329- return { uploadedArtifactId } ;
330313}
331314
332315function applyRemoteArtifactCommand (
0 commit comments