Skip to content

Commit

Permalink
feat: add more support for PAT
Browse files Browse the repository at this point in the history
  • Loading branch information
mjacholke committed Jul 24, 2024
1 parent 079f9aa commit c0c915a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/commands/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export type ConfigurationParameters = {

dstClientId?: string;
dstSecret?: string;
dstPatToken?: string;
dstHubId?: string;
};

Expand Down
6 changes: 5 additions & 1 deletion src/commands/content-item/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,12 @@ export const handler = async (argv: Arguments<CopyItemBuilderOptions & Configura

let result = false;

const { hubId, clientId, clientSecret } = argv;
const { hubId, clientId, clientSecret, patToken } = argv;

const dstHubId = argv.dstHubId || hubId;
const dstClientId = argv.dstClientId || clientId;
const dstSecret = argv.dstSecret || clientSecret;
const dstPatToken = argv.dstPatToken || patToken;

const revertLog = await argv.revertLog;

Expand All @@ -200,6 +201,7 @@ export const handler = async (argv: Arguments<CopyItemBuilderOptions & Configura
hubId: dstHubId,
clientId: dstClientId,
clientSecret: dstSecret,
patToken: dstPatToken,

dir: tempFolder, // unused
logFile: new FileLog(),
Expand All @@ -217,6 +219,7 @@ export const handler = async (argv: Arguments<CopyItemBuilderOptions & Configura
hubId: hubId,
clientId: clientId,
clientSecret: clientSecret,
patToken: patToken,

folderId: argv.srcFolder,
repoId: argv.srcRepo,
Expand All @@ -236,6 +239,7 @@ export const handler = async (argv: Arguments<CopyItemBuilderOptions & Configura
hubId: dstHubId,
clientId: dstClientId,
clientSecret: dstSecret,
patToken: patToken,

dir: tempFolder,

Expand Down

0 comments on commit c0c915a

Please sign in to comment.