Co-authored-by: Catalina Peralta <caperal@microsoft.com>
This commit is contained in:
catalinaperalta 2024-08-21 16:46:03 -07:00 коммит произвёл GitHub
Родитель 2eaf22b95a
Коммит 7aea8e68ab
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 36 добавлений и 38 удалений

Просмотреть файл

@ -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) => {

Просмотреть файл

@ -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, {

Просмотреть файл

@ -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/");