Custom dict extender gone.
This commit is contained in:
parent
4e6b156156
commit
006948801e
@ -114,23 +114,6 @@ interface WaitResult {
|
|||||||
signal: NodeJS.Signals | null;
|
signal: NodeJS.Signals | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a new object being the current environment
|
|
||||||
* plus the values given in the parameter.
|
|
||||||
*/
|
|
||||||
export function extendEnv(extension: {
|
|
||||||
[index: string]: string;
|
|
||||||
}): { [index: string]: string | undefined } {
|
|
||||||
let ret: { [index: string]: string | undefined } = {};
|
|
||||||
for (let v in process.env) {
|
|
||||||
ret[v] = process.env[v];
|
|
||||||
}
|
|
||||||
for (let v in extension) {
|
|
||||||
ret[v] = extension[v];
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run a shell command, return stdout.
|
* Run a shell command, return stdout.
|
||||||
*/
|
*/
|
||||||
|
@ -24,7 +24,6 @@ import {
|
|||||||
pingProc,
|
pingProc,
|
||||||
ProcessWrapper,
|
ProcessWrapper,
|
||||||
runCommand,
|
runCommand,
|
||||||
extendEnv,
|
|
||||||
sh,
|
sh,
|
||||||
} from "./harness";
|
} from "./harness";
|
||||||
|
|
||||||
@ -117,9 +116,7 @@ export class LibeufinSandboxService implements LibeufinSandboxServiceInterface {
|
|||||||
"libeufin-sandbox",
|
"libeufin-sandbox",
|
||||||
["serve", "--port", `${this.sandboxConfig.httpPort}`],
|
["serve", "--port", `${this.sandboxConfig.httpPort}`],
|
||||||
"libeufin-sandbox",
|
"libeufin-sandbox",
|
||||||
extendEnv({
|
{ ...process.env, LIBEUFIN_SANDBOX_DB_CONNECTION: this.sandboxConfig.databaseJdbcUri },
|
||||||
LIBEUFIN_SANDBOX_DB_CONNECTION: this.sandboxConfig.databaseJdbcUri,
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,18 +151,14 @@ export class LibeufinNexusService {
|
|||||||
"libeufin-nexus-superuser",
|
"libeufin-nexus-superuser",
|
||||||
"libeufin-nexus",
|
"libeufin-nexus",
|
||||||
["superuser", "admin", "--password", "test"],
|
["superuser", "admin", "--password", "test"],
|
||||||
extendEnv({
|
{ ...process.env, LIBEUFIN_NEXUS_DB_CONNECTION: this.nexusConfig.databaseJdbcUri }
|
||||||
LIBEUFIN_NEXUS_DB_CONNECTION: this.nexusConfig.databaseJdbcUri,
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
this.nexusProc = this.globalTestState.spawnService(
|
this.nexusProc = this.globalTestState.spawnService(
|
||||||
"libeufin-nexus",
|
"libeufin-nexus",
|
||||||
["serve", "--port", `${this.nexusConfig.httpPort}`],
|
["serve", "--port", `${this.nexusConfig.httpPort}`],
|
||||||
"libeufin-nexus",
|
"libeufin-nexus",
|
||||||
extendEnv({
|
{ ...process.env, LIBEUFIN_NEXUS_DB_CONNECTION: this.nexusConfig.databaseJdbcUri }
|
||||||
LIBEUFIN_NEXUS_DB_CONNECTION: this.nexusConfig.databaseJdbcUri,
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,9 +172,7 @@ export class LibeufinNexusService {
|
|||||||
this.globalTestState,
|
this.globalTestState,
|
||||||
"libeufin-nexus",
|
"libeufin-nexus",
|
||||||
`libeufin-nexus superuser ${details.username} --password=${details.password}`,
|
`libeufin-nexus superuser ${details.username} --password=${details.password}`,
|
||||||
extendEnv({
|
{ ...process.env, LIBEUFIN_NEXUS_DB_CONNECTION: this.nexusConfig.databaseJdbcUri }
|
||||||
LIBEUFIN_NEXUS_DB_CONNECTION: this.nexusConfig.databaseJdbcUri,
|
|
||||||
}),
|
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -242,7 +233,7 @@ export class LibeufinCli {
|
|||||||
this.globalTestState,
|
this.globalTestState,
|
||||||
"libeufin-cli-checksandbox",
|
"libeufin-cli-checksandbox",
|
||||||
"libeufin-cli sandbox check",
|
"libeufin-cli sandbox check",
|
||||||
extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }),
|
{ ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -252,7 +243,7 @@ export class LibeufinCli {
|
|||||||
this.globalTestState,
|
this.globalTestState,
|
||||||
"libeufin-cli-createebicshost",
|
"libeufin-cli-createebicshost",
|
||||||
`libeufin-cli sandbox ebicshost create --host-id=${hostId}`,
|
`libeufin-cli sandbox ebicshost create --host-id=${hostId}`,
|
||||||
extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }),
|
{ ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -267,7 +258,7 @@ export class LibeufinCli {
|
|||||||
` --host-id=${details.hostId}` +
|
` --host-id=${details.hostId}` +
|
||||||
` --partner-id=${details.partnerId}` +
|
` --partner-id=${details.partnerId}` +
|
||||||
` --user-id=${details.userId}`,
|
` --user-id=${details.userId}`,
|
||||||
extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }),
|
{ ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -288,7 +279,7 @@ export class LibeufinCli {
|
|||||||
` --ebics-host-id=${sd.hostId}` +
|
` --ebics-host-id=${sd.hostId}` +
|
||||||
` --ebics-partner-id=${sd.partnerId}` +
|
` --ebics-partner-id=${sd.partnerId}` +
|
||||||
` --ebics-user-id=${sd.userId}`,
|
` --ebics-user-id=${sd.userId}`,
|
||||||
extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }),
|
{ ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -298,7 +289,7 @@ export class LibeufinCli {
|
|||||||
this.globalTestState,
|
this.globalTestState,
|
||||||
"libeufin-cli-generatetransactions",
|
"libeufin-cli-generatetransactions",
|
||||||
`libeufin-cli sandbox bankaccount generate-transactions ${accountName}`,
|
`libeufin-cli sandbox bankaccount generate-transactions ${accountName}`,
|
||||||
extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }),
|
{ ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -308,7 +299,7 @@ export class LibeufinCli {
|
|||||||
this.globalTestState,
|
this.globalTestState,
|
||||||
"libeufin-cli-showsandboxtransactions",
|
"libeufin-cli-showsandboxtransactions",
|
||||||
`libeufin-cli sandbox bankaccount transactions ${accountName}`,
|
`libeufin-cli sandbox bankaccount transactions ${accountName}`,
|
||||||
extendEnv({ LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl }),
|
{ ...process.env, LIBEUFIN_SANDBOX_URL: this.cliDetails.sandboxUrl },
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -324,12 +315,11 @@ export class LibeufinCli {
|
|||||||
` --host-id=${connectionDetails.subscriberDetails.hostId}` +
|
` --host-id=${connectionDetails.subscriberDetails.hostId}` +
|
||||||
` --partner-id=${connectionDetails.subscriberDetails.partnerId}` +
|
` --partner-id=${connectionDetails.subscriberDetails.partnerId}` +
|
||||||
` --ebics-user-id=${connectionDetails.subscriberDetails.partnerId}` +
|
` --ebics-user-id=${connectionDetails.subscriberDetails.partnerId}` +
|
||||||
` ${connectionDetails.connectionName}`,
|
` ${connectionDetails.connectionName}`, {
|
||||||
extendEnv({
|
...process.env, LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||||
}),
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -341,12 +331,11 @@ export class LibeufinCli {
|
|||||||
`libeufin-cli connections export-backup` +
|
`libeufin-cli connections export-backup` +
|
||||||
` --passphrase=${details.passphrase}` +
|
` --passphrase=${details.passphrase}` +
|
||||||
` --output-file=${details.outputFile}` +
|
` --output-file=${details.outputFile}` +
|
||||||
` ${details.connectionName}`,
|
` ${details.connectionName}`, {
|
||||||
extendEnv({
|
...process.env, LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||||
}),
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
@ -356,12 +345,11 @@ export class LibeufinCli {
|
|||||||
this.globalTestState,
|
this.globalTestState,
|
||||||
"libeufin-cli-createkeyletter",
|
"libeufin-cli-createkeyletter",
|
||||||
`libeufin-cli connections get-key-letter` +
|
`libeufin-cli connections get-key-letter` +
|
||||||
` ${details.connectionName} ${details.outputFile}`,
|
` ${details.connectionName} ${details.outputFile}`, {
|
||||||
extendEnv({
|
...process.env, LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
||||||
LIBEUFIN_NEXUS_URL: this.cliDetails.nexusUrl,
|
|
||||||
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
LIBEUFIN_NEXUS_USERNAME: this.cliDetails.user.username,
|
||||||
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
LIBEUFIN_NEXUS_PASSWORD: this.cliDetails.user.password,
|
||||||
}),
|
},
|
||||||
);
|
);
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user