Skip to content

Commit 2c9ab99

Browse files
committed
more logs
1 parent 5c87570 commit 2c9ab99

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

.github/bin/list-workspaces/list-workspaces.mjs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { getFiles } from '../util/get-files.mjs';
33
import fs, { promises as fsp } from 'fs';
44
import { toposort } from '../util/toposort.mjs';
55

6-
const p = (path.posix ?? path);
7-
86
export async function listWorkspaces() {
97
try {
108
const rootPackageJSON = JSON.parse(await fsp.readFile('package.json'));
@@ -32,18 +30,12 @@ export async function listWorkspaces() {
3230
}
3331
}
3432

35-
console.error('---- workspaces ----')
36-
console.error(Array.from(packages.values()));
37-
console.error('---- ----')
38-
39-
4033
const result = [];
4134

4235
for (const packageJSONPath of Array.from(packages)) {
4336
const packageJSON = JSON.parse(await fsp.readFile(packageJSONPath));
44-
const packagePath = p.relative(process.cwd(), path.dirname(packageJSONPath));
45-
46-
console.error(packagePath);
37+
const packagePath = path.relative(process.cwd(), path.dirname(packageJSONPath));
38+
console.error('package relative path - ', packagePath);
4739

4840
result.push({
4941
path: packagePath,

.github/bin/modified-workspaces/list-modified-files.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function getPullRequestFiles(repository, pullRequestNumber, page) {
3636
headers: headers
3737
}, (res) => {
3838
if (!res.statusCode || (Math.floor(res.statusCode / 100) !== 2)) {
39-
throw new Error(`Unepected response code "${res.statusCode}" with message "${res.statusMessage}"`)
39+
throw new Error(`Unexpected response code "${res.statusCode}" with message "${res.statusMessage}"`)
4040
}
4141

4242
let data = [];

.github/bin/modified-workspaces/modified-workspaces.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { listModifiedFilesInPullRequest } from './list-modified-files.mjs';
22
import { listWorkspaces } from '../list-workspaces/list-workspaces.mjs';
3+
import path from 'path';
34

45
const internalDependencies = [
56
'.github/',
@@ -44,6 +45,9 @@ export async function listModifiedWorkspaces() {
4445
const modifiedWorkspaces = new Set();
4546

4647
for (const modifiedFile of modifiedFiles) {
48+
const modifiedFilePath = path.relative(process.cwd(), path.format(path.posix.parse(modifiedFile)));
49+
console.error('modified file - ', modifiedFilePath);
50+
4751
if (modifiedFile.startsWith('e2e/')) {
4852
continue;
4953
}
@@ -67,7 +71,7 @@ export async function listModifiedWorkspaces() {
6771

6872
let isNonWorkspaceFile = true;
6973
for (const workspace of workspaces) {
70-
if (modifiedFile.startsWith(workspace.path)) {
74+
if (modifiedFilePath.startsWith(workspace.path)) {
7175
isNonWorkspaceFile = false;
7276

7377
modifiedWorkspaces.add(workspace.name);

0 commit comments

Comments
 (0)