Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Takeshi committed Feb 18, 2024
1 parent c4f6c50 commit f317689
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ interface GitlyOptions {
* repositories as long as the local git installation has access)
* ```
*/
backend?: 'axios' | 'git',
backend?: 'axios' | 'git'
/**
* Set the git options (default: undefined)
*/
Expand Down
12 changes: 6 additions & 6 deletions src/utils/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ export default async function clone(
}

// Prevent second order command injection

const depth = options?.git?.depth || 1

if (repository.includes('--upload-pack') || directory.includes('--upload-pack')) {
if (
repository.includes('--upload-pack') ||
directory.includes('--upload-pack')
) {
throw new GitlyCloneError('Invalid argument')
}

Expand All @@ -59,7 +62,6 @@ export default async function clone(
throw new GitlyCloneError('Invalid argument')
}


const child = spawn('git', [
'clone',
'--depth',
Expand All @@ -69,9 +71,7 @@ export default async function clone(
])

await new Promise((resolve, reject) => {
child.on('error', (reason) =>
reject(new GitlyCloneError(reason.message))
)
child.on('error', (reason) => reject(new GitlyCloneError(reason.message)))
child.on('close', (code) => {
/* istanbul ignore next */
if (code === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default async function download(
/* istanbul ignore next */
rm(archivePath)
}

return fetch(url, archivePath, options)
}
let order = [local, remote]
Expand Down
1 change: 0 additions & 1 deletion src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ function normalizeURL(url: string, options: GitlyOptions) {
let updatedHost = host || ''

if (isNotProtocol && hasHost) {

// Matches host:owner/repo
const hostMatch = url.match(/([\S]+):.+/)
updatedHost = hostMatch ? hostMatch[1] : ''
Expand Down

0 comments on commit f317689

Please sign in to comment.