File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,16 @@ export interface BackendOpts {
10
10
projectId : string ;
11
11
}
12
12
13
+ function expandEnvVars ( template : string ) {
14
+ return template . replace ( / \$ \{ ( \w + ) \} / g, ( _ , key ) => process . env [ key ] ?? "" ) ;
15
+ }
16
+
13
17
export class Pipedream extends PipedreamClient {
14
18
public constructor ( opts : BackendOpts ) {
15
19
const {
16
20
clientId = process . env . PIPEDREAM_CLIENT_ID ,
17
21
clientSecret = process . env . PIPEDREAM_CLIENT_SECRET ,
18
- environment = environments . PipedreamEnvironment . Prod ,
22
+ environment : rawEnvironment = environments . PipedreamEnvironment . Prod ,
19
23
projectEnvironment = process . env . PIPEDREAM_PROJECT_ENVIRONMENT ?? "production" ,
20
24
projectId = process . env . PIPEDREAM_PROJECT_ID ,
21
25
} = opts ;
@@ -29,6 +33,8 @@ export class Pipedream extends PipedreamClient {
29
33
throw new Error ( "Project ID is required" ) ;
30
34
}
31
35
36
+ const environment = expandEnvVars ( rawEnvironment . toString ( ) ) ;
37
+
32
38
super ( {
33
39
clientId,
34
40
clientSecret,
You can’t perform that action at this time.
0 commit comments