(readmeUrl: string)
| 27 | |
| 28 | // Generate OS-specific commands to open the GitHub pages needed for setup. |
| 29 | function getOpenUrlsCommands(readmeUrl: string): string[] { |
| 30 | // Determine the OS-specific command to open URLs, ex: 'open', 'xdg-open', etc |
| 31 | const openCmd = getUrlOpenCommand(); |
| 32 | |
| 33 | // Build a list of URLs to open |
| 34 | const urlsToOpen = [readmeUrl]; |
| 35 | |
| 36 | const repoInfo = getGitHubRepoInfo(); |
| 37 | if (repoInfo) { |
| 38 | urlsToOpen.push( |
| 39 | `https://github.com/${repoInfo.owner}/${repoInfo.repo}/settings/secrets/actions`, |
| 40 | ); |
| 41 | } |
| 42 | |
| 43 | // Create and join the individual commands |
| 44 | const commands = urlsToOpen.map((url) => `${openCmd} "${url}"`); |
| 45 | return commands; |
| 46 | } |
| 47 | |
| 48 | export const setupGithubCommand: SlashCommand = { |
| 49 | name: 'setup-github', |
no test coverage detected