@@ -10,6 +10,7 @@ import * as NodeServices from "@effect/platform-node/NodeServices";
1010import * as HostProcess from "@t3tools/shared/HostProcess" ;
1111import * as NetService from "@t3tools/shared/Net" ;
1212import * as Clock from "effect/Clock" ;
13+ import * as Config from "effect/Config" ;
1314import * as Deferred from "effect/Deferred" ;
1415import * as Duration from "effect/Duration" ;
1516import * as Effect from "effect/Effect" ;
@@ -29,7 +30,12 @@ import { ChildProcess, ChildProcessSpawner } from "effect/process";
2930
3031import * as SshAuth from "./auth.ts" ;
3132import { remoteStateKey } from "./command.ts" ;
32- import { SshCommandError , SshPairingError , SshPasswordPromptError , SshReadinessError } from "./errors.ts" ;
33+ import {
34+ SshCommandError ,
35+ SshPairingError ,
36+ SshPasswordPromptError ,
37+ SshReadinessError ,
38+ } from "./errors.ts" ;
3339import * as SshTunnel from "./tunnel.ts" ;
3440
3541const isSshCommandError = Schema . is ( SshCommandError ) ;
@@ -294,6 +300,7 @@ describe("ssh tunnel scripts", () => {
294300 const credential = mode === "archive" ? `paired-${ serverVersion } ` : "paired-dev" ;
295301 const fs = yield * FileSystem . FileSystem ;
296302 const localSpawner = yield * ChildProcessSpawner . ChildProcessSpawner ;
303+ const path = yield * Config . String ( "PATH" ) . pipe ( Config . withDefault ( "" ) ) ;
297304 const home = yield * fs . makeTempDirectoryScoped ( { prefix : "t3-ssh-pairing-" } ) ;
298305 for ( const version of [ serverVersion , ARCHIVE . archiveVersion ] ) {
299306 const runtime = `${ home } /.t3/runtime/versions/${ version } ` ;
@@ -345,7 +352,7 @@ describe("ssh tunnel scripts", () => {
345352 if ( script . includes ( "PAIRING_BASE_DIR=" ) ) {
346353 return yield * localSpawner . spawn (
347354 ChildProcess . make ( "sh" , [ "-s" ] , {
348- env : { HOME : home , PATH : process . env . PATH ?? "" } ,
355+ env : { HOME : home , PATH : path } ,
349356 stdin : {
350357 stream : Stream . make ( new TextEncoder ( ) . encode ( script ) ) ,
351358 endOnDone : true ,
@@ -394,7 +401,10 @@ describe("ssh tunnel scripts", () => {
394401 ) ,
395402 Effect . scoped ,
396403 ) ;
397- } ) . pipe ( Effect . provide ( NodeServices . layer ) , Effect . scoped ) ,
404+ } ) . pipe (
405+ Effect . provide ( Layer . mergeAll ( NodeServices . layer , NodeCrypto . layer ) ) ,
406+ Effect . scoped ,
407+ ) ,
398408 ) ;
399409 } ) ;
400410
@@ -454,6 +464,7 @@ describe("ssh tunnel scripts", () => {
454464 Effect . provide (
455465 Layer . mergeAll (
456466 NodeServices . layer ,
467+ NodeCrypto . layer ,
457468 Layer . succeed ( ChildProcessSpawner . ChildProcessSpawner , spawner ) ,
458469 Layer . succeed ( HttpClient . HttpClient , testHttpClient ) ,
459470 Layer . succeed ( NetService . NetService , testNetService ) ,
0 commit comments