Skip to content

Commit 35c1b5b

Browse files
committed
update tutorial script
1 parent 5043153 commit 35c1b5b

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎scripts/tutorial-manager.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ if (import.meta.main) {
4343
console.log(
4444
" sync-docs - Sync docs content to docs repo",
4545
);
46+
console.log(
47+
" pull - Rebase all tutorial branches from their remotes",
48+
);
49+
console.log(
50+
" push - Rebase and push all tutorial branches",
51+
);
4652
process.exit(1);
4753
}
4854
} catch (error) {
@@ -67,10 +73,12 @@ async function push(): Promise<void> {
6773

6874
for (const stage of tutorialConfig.stages) {
6975
await switchBranch(stage.name);
76+
await pullBranch();
7077
await pushBranch();
7178
}
7279

7380
await switchBranch("main");
81+
await pullBranch();
7482
await pushBranch();
7583

7684
await switchBranch(currentBranch);

‎scripts/utils.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export async function pushBranch(): Promise<void> {
8585
}
8686

8787
export async function pullBranch(): Promise<void> {
88-
const proc = Bun.spawn(["git", "pull", "--rebase"], {
88+
const proc = Bun.spawn(["git", "pull", "--rebase", "--autostash"], {
8989
stdout: "pipe",
9090
stderr: "pipe",
9191
});

0 commit comments

Comments
 (0)