Skip to content

Commit

Permalink
prettier (#8836)
Browse files Browse the repository at this point in the history
Co-authored-by: Catalina Peralta <[email protected]>
  • Loading branch information
catalinaperalta and cperaltah authored Aug 21, 2024
1 parent 2eaf22b commit 7aea8e6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 38 deletions.
68 changes: 34 additions & 34 deletions tools/tsp-client/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,43 @@ export async function cloneRepo(rootUrl: string, cloneDir: string, repo: string)
});
}

export async function sparseCheckout(cloneDir: string): Promise<void> {
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<void> {
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<void> {
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<void> {
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<void> {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion tools/tsp-client/src/npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function npmCommand(workingDir: string, args: string[]): Promise<vo
}

export async function nodeCommand(workingDir: string, args: string[]): Promise<void> {
Logger.debug("node " + args.join(' '));
Logger.debug("node " + args.join(" "));

return new Promise((resolve, reject) => {
const node = spawn("node", args, {
Expand Down
4 changes: 1 addition & 3 deletions tools/tsp-client/test/tspLocation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/");

Expand Down

0 comments on commit 7aea8e6

Please sign in to comment.