Skip to content

Commit

Permalink
Fix trailing slash issue in remote cloning (#42)
Browse files Browse the repository at this point in the history
* Fix trailing slash issue in remote cloning

* Create fuzzy-badgers-do.md
  • Loading branch information
yanthomasdev authored Nov 4, 2023
1 parent 14c5546 commit 84cdc2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fuzzy-badgers-do.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lunariajs/core": patch
---

Fix trailing slash issue in remote cloning
3 changes: 2 additions & 1 deletion packages/core/src/utils/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { existsSync, rmSync } from 'node:fs';
import os from 'node:os';
import { resolve } from 'node:path';
import { simpleGit } from 'simple-git';
import { withoutTrailingSlash } from 'ufo';
import type { LunariaConfig } from '../types.js';

const git = simpleGit({
Expand All @@ -23,7 +24,7 @@ export async function handleShallowRepo({ cloneDir, repository }: LunariaConfig)

if (existsSync(target)) rmSync(target, { recursive: true, force: true });

const remote = `${repository}.git`;
const remote = `${withoutTrailingSlash(repository)}.git`;

await git.clone(remote, target, ['--bare', '--filter=blob:none']);
// Use the clone as the git directory for all tasks
Expand Down

0 comments on commit 84cdc2c

Please sign in to comment.