Skip to content

Commit

Permalink
feat: add elevation repo to github push
Browse files Browse the repository at this point in the history
  • Loading branch information
amfage committed Aug 11, 2023
1 parent 736fad7 commit a7d607f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/commands/stac-github-import/stac.github.import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@ export const commandStacGithubImport = command({
repoName: option({
type: string,
long: 'repo-name',
description: 'Repository name either linz/imagery or linz/elevation',
defaultValue: () => 'linz/imagery',
description: 'Repository name source for either linz/imagery or linz/elevation',
defaultValue: () => 'imagery',
defaultValueIsSerializable: true,
}),
},

async handler(args) {
registerCli(this, args);

const gitName = process.env['GIT_AUTHOR_NAME'] ?? 'imagery[bot]';
const gitEmail = process.env['GIT_AUTHOR_EMAIL'] ?? 'imagery@linz.govt.nz';
const linzRepoName = `linz/${args.repoName}`;
const gitName = `${args.repoName}[bot]`;
const gitEmail = `${args.repoName}, "@linz.govt.nz")`;

const sourceCollection = new URL('collection.json', args.source);
const targetCollection = new URL('collection.json', args.target);
Expand All @@ -57,7 +58,7 @@ export const commandStacGithubImport = command({

// Clone the GitHub repo
logger.info({ repo: args.repoName }, 'Git:clone');
execFileSync('git', ['clone', `git@github.com:${args.repoName}`, gitRepo]);
execFileSync('git', ['clone', `git@github.com:${linzRepoName}`, gitRepo]);
execFileSync('git', ['config', 'user.email', gitEmail], { cwd: gitRepo });
execFileSync('git', ['config', 'user.name', gitName], { cwd: gitRepo });

Expand Down

0 comments on commit a7d607f

Please sign in to comment.