forked from denoland/deno_ast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01_setup.ts
More file actions
executable file
·26 lines (22 loc) · 777 Bytes
/
01_setup.ts
File metadata and controls
executable file
·26 lines (22 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env -S deno run -A
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { Repos } from "./repos.ts";
import { $ } from "@deno/rust-automation";
const repos = await Repos.load();
// Ensure repos are latest main
for (const repo of repos.nonDenoAstRepos()) {
$.logStep("Setting up", `${repo.name}...`);
if (await repo.hasLocalChanges()) {
throw new Error(
`Repo ${repo.name} had local changes. Please resolve this.`,
);
}
$.logGroup();
$.logStep("Switching to main...");
await repo.command("git switch main");
$.logStep("Pulling upstream main...");
await repo.command("git pull upstream main");
$.logGroupEnd();
}
// Update the repos to refer to local versions of each other
await repos.toLocalSource();