diff --git a/acceptance-tests/yarn.lock b/acceptance-tests/yarn.lock index 793c22df0..2d485e419 100644 --- a/acceptance-tests/yarn.lock +++ b/acceptance-tests/yarn.lock @@ -368,10 +368,10 @@ concat-stream@^2.0.0: readable-stream "^3.0.2" typedarray "^0.0.6" -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== +cross-spawn@^7.0.5: + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" diff --git a/lib/projects/index.ts b/lib/projects/index.ts index 9a86d6b1e..963ca14ae 100644 --- a/lib/projects/index.ts +++ b/lib/projects/index.ts @@ -2,14 +2,16 @@ import fs from 'fs-extra'; import path from 'path'; import findup from 'findup-sync'; import { logger } from '@hubspot/local-dev-lib/logger'; -import { fetchFileFromRepository } from '@hubspot/local-dev-lib/github'; +import { + cloneGithubRepo, + fetchFileFromRepository, +} from '@hubspot/local-dev-lib/github'; import { createProject, fetchProject, } from '@hubspot/local-dev-lib/api/projects'; import { isSpecifiedError } from '@hubspot/local-dev-lib/errors/index'; import { getCwd, getAbsoluteFilePath } from '@hubspot/local-dev-lib/path'; -import { downloadGithubRepoContents } from '@hubspot/local-dev-lib/github'; import { RepoPath } from '@hubspot/local-dev-lib/types/Github'; import { Project } from '@hubspot/local-dev-lib/types/Project'; import { HubSpotPromise } from '@hubspot/local-dev-lib/types/Http'; @@ -134,12 +136,15 @@ export async function createProjectConfig( const hasCustomTemplateSource = Boolean(templateSource); - await downloadGithubRepoContents( + await cloneGithubRepo( templateSource || HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH, - template.path, projectPath, - hasCustomTemplateSource ? undefined : githubRef + { + sourceDir: template.path, + tag: hasCustomTemplateSource ? undefined : githubRef, + } ); + const _config: ProjectConfig = JSON.parse( fs.readFileSync(projectConfigPath).toString() ); @@ -351,12 +356,10 @@ export async function createProjectComponent( componentName ); - await downloadGithubRepoContents( - HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH, - component.path, - componentPath, - projectComponentsVersion - ); + await cloneGithubRepo(HUBSPOT_PROJECT_COMPONENTS_GITHUB_PATH, componentPath, { + sourceDir: component.path, + tag: projectComponentsVersion, + }); } export async function getProjectComponentsByVersion(