Skip to content

Commit 834d18b

Browse files
designcodeclaude
andcommitted
chore: pr comments
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0a8b02b commit 834d18b

7 files changed

Lines changed: 35 additions & 22 deletions

File tree

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: Pull Request
1+
name: CI
22

33
on:
44
pull_request:
55
branches:
66
- main
77
- next
8+
push:
9+
branches:
10+
- main
811

912
jobs:
1013
build:
@@ -25,8 +28,7 @@ jobs:
2528

2629
integration:
2730
runs-on: ubuntu-latest
28-
if: github.event.pull_request.base.ref == 'main'
29-
environment: integration
31+
if: github.event_name == 'push'
3032
steps:
3133
- uses: actions/checkout@v4
3234
with:

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"test": "vitest run test/utils test/cli-core.test.ts test/specs-completeness.test.ts",
3333
"test:watch": "vitest",
3434
"test:all": "vitest run",
35-
"test:unit": "vitest run test/utils test/cli-core.test.ts test/specs-completeness.test.ts",
3635
"test:integration": "vitest run test/cli.test.ts",
3736
"publint": "publint",
3837
"updatedocs": "tsx scripts/update-docs.ts",

src/lib/buckets/delete.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,25 @@ export default async function deleteBucket(options: Record<string, unknown>) {
3939
}
4040
}
4141

42-
const results: string[] = [];
42+
const deleted: string[] = [];
43+
const errors: { name: string; error: string }[] = [];
4344
for (const name of bucketNames) {
4445
const { error } = await removeBucket(name, { config });
4546

4647
if (error) {
4748
printFailure(context, error.message, { name });
48-
process.exit(1);
49+
errors.push({ name, error: error.message });
50+
} else {
51+
deleted.push(name);
52+
printSuccess(context, { name });
4953
}
50-
51-
results.push(name);
52-
printSuccess(context, { name });
5354
}
5455

5556
if (format === 'json') {
56-
console.log(JSON.stringify({ action: 'deleted', names: results }));
57+
console.log(JSON.stringify({ action: 'deleted', names: deleted, errors }));
58+
}
59+
60+
if (errors.length > 0) {
61+
process.exit(1);
5762
}
5863
}

src/lib/cp.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ async function copyLocalToRemote(
435435
destParsed.bucket,
436436
destKey,
437437
config,
438-
true
438+
!_jsonMode
439439
);
440440
if (result.error) {
441441
console.error(result.error);
@@ -602,7 +602,7 @@ async function copyRemoteToLocal(
602602
srcParsed.path,
603603
localFilePath,
604604
config,
605-
true
605+
!_jsonMode
606606
);
607607
if (result.error) {
608608
console.error(result.error);
@@ -831,7 +831,7 @@ async function copyRemoteToRemote(
831831
srcParsed.path,
832832
destParsed.bucket,
833833
destKey,
834-
true
834+
!_jsonMode
835835
);
836836

837837
if (result.error) {
@@ -870,7 +870,7 @@ export default async function cp(options: Record<string, unknown>) {
870870
const jsonFlag = getOption<boolean>(options, ['json']);
871871
const format = jsonFlag
872872
? 'json'
873-
: getOption<string>(options, ['format', 'f', 'F'], 'table');
873+
: getOption<string>(options, ['format'], 'table');
874874
_jsonMode = format === 'json';
875875

876876
const direction = detectDirection(src, dest);

src/lib/mv.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default async function mv(options: Record<string, unknown>) {
2323
const jsonFlag = getOption<boolean>(options, ['json']);
2424
const format = jsonFlag
2525
? 'json'
26-
: getOption<string>(options, ['format', 'f', 'F'], 'table');
26+
: getOption<string>(options, ['format'], 'table');
2727
_jsonMode = format === 'json';
2828

2929
if (!src || !dest) {
@@ -289,7 +289,7 @@ export default async function mv(options: Record<string, unknown>) {
289289
srcPath.path,
290290
destPath.bucket,
291291
destKey,
292-
true // show progress for single file
292+
!_jsonMode // show progress for single file (not in JSON mode)
293293
);
294294

295295
if (result.error) {

src/lib/objects/delete.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default async function deleteObject(options: Record<string, unknown>) {
4848
}
4949

5050
const deleted: string[] = [];
51+
const errors: { key: string; error: string }[] = [];
5152
for (const key of keyList) {
5253
const { error } = await remove(key, {
5354
config: {
@@ -58,14 +59,20 @@ export default async function deleteObject(options: Record<string, unknown>) {
5859

5960
if (error) {
6061
printFailure(context, error.message, { key });
61-
process.exit(1);
62+
errors.push({ key, error: error.message });
63+
} else {
64+
deleted.push(key);
65+
printSuccess(context, { key });
6266
}
63-
64-
deleted.push(key);
65-
printSuccess(context, { key });
6667
}
6768

6869
if (format === 'json') {
69-
console.log(JSON.stringify({ action: 'deleted', bucket, keys: deleted }));
70+
console.log(
71+
JSON.stringify({ action: 'deleted', bucket, keys: deleted, errors })
72+
);
73+
}
74+
75+
if (errors.length > 0) {
76+
process.exit(1);
7077
}
7178
}

src/lib/rm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default async function rm(options: Record<string, unknown>) {
2020
const jsonFlag = getOption<boolean>(options, ['json']);
2121
const format = jsonFlag
2222
? 'json'
23-
: getOption<string>(options, ['format', 'f', 'F'], 'table');
23+
: getOption<string>(options, ['format'], 'table');
2424
_jsonMode = format === 'json';
2525

2626
if (!pathString) {

0 commit comments

Comments
 (0)