Skip to content

Commit 4cda4db

Browse files
committed
updates tar extraction depth drive off of paths.length
1 parent dabd561 commit 4cda4db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const getTar = ({
3131
repo,
3232
path = '',
3333
name,
34-
depth = 3
34+
depth
3535
}) => {
3636
const url = `https://codeload.github.com/${user}/${repo}/tar.gz/master`
3737
const cmd = `curl ${url} | tar -xz -C ${name} --strip=${depth} ${repo}-master/${path}`
@@ -52,7 +52,7 @@ const create = async (opts = {}) => {
5252
const dirname = path.resolve(opts.name)
5353
const name = path.basename(dirname)
5454
const [ user, repo, ...paths ] = opts.template.split('/')
55-
const depth = opts.templateDepth
55+
const depth = paths.length+1
5656

5757
fs.ensureDirSync(name)
5858

0 commit comments

Comments
 (0)