diff --git a/tools/tsp-client/src/git.ts b/tools/tsp-client/src/git.ts index e14d3e75228..79f6f2ceefd 100644 --- a/tools/tsp-client/src/git.ts +++ b/tools/tsp-client/src/git.ts @@ -16,43 +16,43 @@ export async function cloneRepo(rootUrl: string, cloneDir: string, repo: string) }); } - export async function sparseCheckout(cloneDir: string): Promise { - return new Promise((resolve, reject) => { - const git = spawn("git", ["sparse-checkout", "init"], { - cwd: cloneDir, - stdio: "inherit", - }); - git.once("exit", (code) => { - if (code === 0) { - resolve(); - } else { - reject(new Error(`git sparse-checkout failed exited with code ${code}`)); - } - }); - git.once("error", (err) => { - reject(new Error(`git sparse-checkout failed with error: ${err}`)); - }); +export async function sparseCheckout(cloneDir: string): Promise { + return new Promise((resolve, reject) => { + const git = spawn("git", ["sparse-checkout", "init"], { + cwd: cloneDir, + stdio: "inherit", + }); + git.once("exit", (code) => { + if (code === 0) { + resolve(); + } else { + reject(new Error(`git sparse-checkout failed exited with code ${code}`)); + } }); - } + git.once("error", (err) => { + reject(new Error(`git sparse-checkout failed with error: ${err}`)); + }); + }); +} - export async function addSpecFiles(cloneDir: string, subDir: string): Promise { - return new Promise((resolve, reject) => { - const git = spawn("git", ["sparse-checkout", "add", subDir], { - cwd: cloneDir, - stdio: "inherit", - }); - git.once("exit", (code) => { - if (code === 0) { - resolve(); - } else { - reject(new Error(`git sparse-checkout add failed exited with code ${code}`)); - } - }); - git.once("error", (err) => { - reject(new Error(`git sparse-checkout add failed with error: ${err}`)); - }); +export async function addSpecFiles(cloneDir: string, subDir: string): Promise { + return new Promise((resolve, reject) => { + const git = spawn("git", ["sparse-checkout", "add", subDir], { + cwd: cloneDir, + stdio: "inherit", + }); + git.once("exit", (code) => { + if (code === 0) { + resolve(); + } else { + reject(new Error(`git sparse-checkout add failed exited with code ${code}`)); + } }); - } + git.once("error", (err) => { + reject(new Error(`git sparse-checkout add failed with error: ${err}`)); + }); + }); +} export async function checkoutCommit(cloneDir: string, commit: string): Promise { return new Promise((resolve, reject) => { diff --git a/tools/tsp-client/src/npm.ts b/tools/tsp-client/src/npm.ts index 58ed8ec0d08..11494ff129b 100644 --- a/tools/tsp-client/src/npm.ts +++ b/tools/tsp-client/src/npm.ts @@ -39,7 +39,7 @@ export async function npmCommand(workingDir: string, args: string[]): Promise { - Logger.debug("node " + args.join(' ')); + Logger.debug("node " + args.join(" ")); return new Promise((resolve, reject) => { const node = spawn("node", args, { diff --git a/tools/tsp-client/test/tspLocation.spec.ts b/tools/tsp-client/test/tspLocation.spec.ts index c72259daf60..3ef69a7beb3 100644 --- a/tools/tsp-client/test/tspLocation.spec.ts +++ b/tools/tsp-client/test/tspLocation.spec.ts @@ -28,9 +28,7 @@ describe("Verify tsp-location.yaml", function () { directory: "specification/contosowidgetmanager/Contoso.WidgetManager", commit: "1234567", repo: "foo", - additionalDirectories: [ - "specification/contosowidgetmanager/Contoso.WidgetManager.Shared", - ], + additionalDirectories: ["specification/contosowidgetmanager/Contoso.WidgetManager.Shared"], }; await writeTspLocationYaml(tspLocation, "./test/examples/");