Skip to content

Commit

Permalink
work on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jtoar committed Feb 27, 2024
1 parent 3b17a0e commit 8176977
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@ jobs:
fetch-depth: 0
path: redwood

- name: ls
run: |
pwd && echo
ls && echo
ls && echo
ls ../
- name: 🧪 Test
run: cd release-tooling && yarn test ./triage
env:
Expand Down
14 changes: 10 additions & 4 deletions lib/cwd.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import { cd } from "zx"
import { cd, fs } from "zx"

import { CustomError } from './error.js'

export function setCwd() {
const RWFW_PATH = process.env.RWFW_PATH;
export async function setCwd() {
let RWFW_PATH = process.env.RWFW_PATH;

if (!RWFW_PATH) {
throw new CustomError("RWFW_PATH isn't set. Set it to the path of the Redwood monorepo.");
throw new CustomError("`RWFW_PATH` isn't set. Set it to the path of the Redwood monorepo.");
}

try {
RWFW_PATH = await fs.realpath(RWFW_PATH)
} catch (error) {
throw new CustomError(`\`RWFW_PATH\` is set to "${RWFW_PATH}" but it doesn't exist at that path.`)
}

const originalCwd = process.cwd()
Expand Down
2 changes: 1 addition & 1 deletion release/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { assertNoNoMilestonePrs } from './lib/milestones.js'
import { release } from './lib/release.js'

try {
setCwd()
await setCwd()
await assertWorkTreeIsClean()
await assertNoNoMilestonePrs()

Expand Down
2 changes: 1 addition & 1 deletion scripts/reset_next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { REMOTE } from '@lib/github.js'
import { resIsYes } from '@lib/prompts.js'

if (resIsYes(await question('Ok to reset next to origin/next? [Y/n] > '))) {
setCwd()
await setCwd()
await $`git switch next`
await $`git fetch ${REMOTE}`
await $`git reset --hard ${REMOTE}/next`
Expand Down
4 changes: 2 additions & 2 deletions triage/lib/resolve_symmetric_difference.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ $.verbose = false

describe('resolveSymmetricDifference', () => {
let resetCwd: () => void
beforeAll(() => {
resetCwd = setCwd()
beforeAll(async () => {
resetCwd = await setCwd()
})
afterAll(() => {
resetCwd()
Expand Down
8 changes: 4 additions & 4 deletions triage/lib/triage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ test('defaultGitLogOptions', () => {

describe('getSymmetricDifference', () => {
let resetCwd: () => void
beforeAll(() => {
resetCwd = setCwd()
beforeAll(async () => {
resetCwd = await setCwd()
})
afterAll(() => {
resetCwd()
Expand Down Expand Up @@ -271,8 +271,8 @@ test('lineIsChore', () => {

describe('resolveLine', async () => {
let resetCwd: () => void
beforeAll(() => {
resetCwd = setCwd()
beforeAll(async () => {
resetCwd = await setCwd()
})
afterAll(() => {
resetCwd()
Expand Down
2 changes: 1 addition & 1 deletion triage/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getOptions } from './lib/options.js'
import { triageRange } from "./lib/triage.js";

try {
setCwd()
await setCwd()
await assertWorkTreeIsClean()

const options = await getOptions()
Expand Down

0 comments on commit 8176977

Please sign in to comment.