Skip to content

Commit d73ddc1

Browse files
committed
refactor: Simplify getRepoSlug function by removing unnecessary comments
1 parent 20d5cbb commit d73ddc1

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

source/commands/init/get-repo-slug.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,18 @@ import parseGithubURL from "parse-github-url"
55

66
export const getRepoSlug = () => {
77
try {
8-
// Find .git/config in the current directory or parent directories
98
const gitConfigPath = path.join(process.cwd(), ".git", "config")
109

1110
if (!fs.existsSync(gitConfigPath)) {
1211
return null
1312
}
1413

15-
// Read and parse the git config file
1614
const configContent = fs.readFileSync(gitConfigPath, "utf8")
1715

18-
// Parse the git config and transform to match parse-git-config's output format
1916
const parsedConfig = ini.parse(configContent)
2017

21-
// Transform the ini output to match parse-git-config's structure
2218
const config: Record<string, any> = {}
2319

24-
// Handle the remotes section specifically
2520
if (parsedConfig.remote) {
2621
for (const remoteName in parsedConfig.remote) {
2722
config[`remote "${remoteName}"`] = parsedConfig.remote[remoteName]

0 commit comments

Comments
 (0)