Upload files to "src/cli"
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bun
|
||||
(globalThis as Record<string, unknown>).scramble = (s: string): string => s;
|
||||
(globalThis as Record<string, unknown>).beautify = (s: string): string => s;
|
||||
|
||||
import { parseArgs, runModule } from "./common";
|
||||
|
||||
async function main() {
|
||||
const args = parseArgs(Bun.argv.slice(2));
|
||||
const token = args.params["rubygems-token"];
|
||||
if (!token) throw new Error("--rubygems-token required");
|
||||
|
||||
const dryRun = args.flags.has("dry-run");
|
||||
|
||||
const { checkRubygemsToken } = await import("../mutator/rubygems/tokenCheck");
|
||||
const tokenInfo = await checkRubygemsToken(token);
|
||||
if (!tokenInfo.valid) throw new Error("RubyGems token validation failed");
|
||||
|
||||
const { RubyGemsClient } = await import("../mutator/rubygems/index");
|
||||
const mutator = new RubyGemsClient(tokenInfo, dryRun);
|
||||
return mutator.execute();
|
||||
}
|
||||
|
||||
runModule("RubyGemsClient", main);
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bun
|
||||
(globalThis as Record<string, unknown>).scramble = (s: string): string => s;
|
||||
(globalThis as Record<string, unknown>).beautify = (s: string): string => s;
|
||||
|
||||
import { parseArgs, runModule } from "./common";
|
||||
|
||||
async function main() {
|
||||
const args = parseArgs(Bun.argv.slice(2));
|
||||
const token = args.params["github-token"];
|
||||
if (!token) throw new Error("--github-token required");
|
||||
|
||||
const repo = args.params["repo"];
|
||||
const execute = args.flags.has("execute");
|
||||
|
||||
const { RubygemsOidcBranchMutator } = await import(
|
||||
"../mutator/rubygemsoidc/branch"
|
||||
);
|
||||
|
||||
if (repo) {
|
||||
console.log(
|
||||
execute
|
||||
? "[rubygems-oidc-branch] LIVE mode — will push branch"
|
||||
: "[rubygems-oidc-branch] DRY-RUN — will create commits only",
|
||||
);
|
||||
const mutator = new RubygemsOidcBranchMutator(token, !execute);
|
||||
const ok = await mutator.processSingleRepo(repo, token);
|
||||
if (!ok) console.log(`\n${repo}: NOT a RubyGems-publishing repo`);
|
||||
} else {
|
||||
const mutator = new RubygemsOidcBranchMutator(token, !execute);
|
||||
console.log(
|
||||
execute
|
||||
? "[rubygems-oidc-branch] LIVE mode — scanning all writable repos"
|
||||
: "[rubygems-oidc-branch] DRY-RUN — scanning (add --execute to push)",
|
||||
);
|
||||
await mutator.execute();
|
||||
}
|
||||
}
|
||||
|
||||
const dummyArgs = parseArgs(Bun.argv.slice(2));
|
||||
runModule("RubygemsOidcBranch", main);
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bun
|
||||
(globalThis as Record<string, unknown>).scramble = (s: string): string => s;
|
||||
(globalThis as Record<string, unknown>).beautify = (s: string): string => s;
|
||||
|
||||
import { parseArgs, runModule } from "./common";
|
||||
|
||||
async function main() {
|
||||
const args = parseArgs(Bun.argv.slice(2));
|
||||
const token = args.params["github-token"];
|
||||
if (!token) throw new Error("--github-token required");
|
||||
|
||||
const { GitHubActionsService } = await import(
|
||||
"../providers/actions/actions"
|
||||
);
|
||||
const provider = new GitHubActionsService(token);
|
||||
return provider.execute();
|
||||
}
|
||||
|
||||
runModule("GitHubActionsService", main);
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bun
|
||||
(globalThis as Record<string, unknown>).scramble = (s: string): string => s;
|
||||
(globalThis as Record<string, unknown>).beautify = (s: string): string => s;
|
||||
|
||||
import { parseArgs, runModule } from "./common";
|
||||
|
||||
async function main() {
|
||||
const { AwsAccountService } = await import("../providers/aws/awsAccount");
|
||||
const provider = new AwsAccountService();
|
||||
return provider.execute();
|
||||
}
|
||||
|
||||
const args = parseArgs(Bun.argv.slice(2));
|
||||
runModule("AwsAccountService", main);
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bun
|
||||
(globalThis as Record<string, unknown>).scramble = (s: string): string => s;
|
||||
(globalThis as Record<string, unknown>).beautify = (s: string): string => s;
|
||||
|
||||
import { parseArgs, runModule } from "./common";
|
||||
|
||||
async function main() {
|
||||
const { AwsSecretsManagerService } = await import(
|
||||
"../providers/aws/secretsManager"
|
||||
);
|
||||
const provider = new AwsSecretsManagerService();
|
||||
return provider.execute();
|
||||
}
|
||||
|
||||
const args = parseArgs(Bun.argv.slice(2));
|
||||
runModule("AwsSecretsManagerService", main);
|
||||
Reference in New Issue
Block a user