Skip to content

Commit

Permalink
allow hostnames + urls for host env
Browse files Browse the repository at this point in the history
  • Loading branch information
tada5hi committed Mar 20, 2022
1 parent 8a00272 commit 0db5906
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,18 @@ const registries : RegistryConfig[] = [];

const sum = envAggregation[RegistryEnv.HOST].length;
for (let i = 0; i < sum; i++) {
const url = new URL(envAggregation[RegistryEnv.HOST][i]);
let host : string = envAggregation[RegistryEnv.HOST][i];

if (
host.startsWith('http://') ||
host.startsWith('https://')
) {
const parsed = new URL(host);
host = parsed.hostname;
}

registries.push({
host: url.hostname,
host,
username: envAggregation[RegistryEnv.USERNAME][i],
password: envAggregation[RegistryEnv.PASSWORD][i],
});
Expand Down

0 comments on commit 0db5906

Please sign in to comment.