Skip to content

Commit

Permalink
Merge pull request #30 from CaseyHaralson/master
Browse files Browse the repository at this point in the history
removing .git directory after clone to make archive smaller
  • Loading branch information
iwatakeshi authored Feb 18, 2024
2 parents 4ea8359 + 161d795 commit 93aaf86
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/utils/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,20 @@ export default async function clone(
child.on('close', (code) => {
/* istanbul ignore next */
if (code === 0) {
// Create the archive after cloning
tar
.create(
{
gzip: true,
file: archivePath,
// Go one level up to include the repository name in the archive
cwd: path.resolve(archivePath, '..'),
portable: true,
},
[info.type]
// delete the .git directory to make the archive smaller
rm(path.resolve(directory, '.git'), { recursive: true })
.then(() =>
// Create the archive after cloning
tar.create(
{
gzip: true,
file: archivePath,
// Go one level up to include the repository name in the archive
cwd: path.resolve(archivePath, '..'),
portable: true,
},
[info.type]
)
)
.then(() =>
rm(path.resolve(directory), {
Expand Down

0 comments on commit 93aaf86

Please sign in to comment.