Skip to content

Commit b04947b

Browse files
committed
chore: address pr comments
1 parent 2c2ab89 commit b04947b

5 files changed

Lines changed: 39 additions & 23 deletions

File tree

scripts/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ cleanup_old_install() {
178178
for PROFILE_FILE in "$HOME/.zshrc" "$HOME/.bashrc" "$HOME/.bash_profile" "$HOME/.profile"; do
179179
if [ -f "$PROFILE_FILE" ] && grep -q '\.tigris/bin' "$PROFILE_FILE" 2>/dev/null; then
180180
# Filter out the Tigris CLI comment and export line
181-
grep -v '# Tigris CLI' "$PROFILE_FILE" | grep -v '\.tigris/bin' > "${PROFILE_FILE}.tmp"
181+
{ grep -v '# Tigris CLI' "$PROFILE_FILE" | grep -v '\.tigris/bin' || true; } > "${PROFILE_FILE}.tmp"
182182
mv "${PROFILE_FILE}.tmp" "$PROFILE_FILE"
183183
info "Removed old PATH entry from $PROFILE_FILE"
184184
fi

src/lib/buckets/create.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ export default async function create(options: Record<string, unknown>) {
164164
message: c.name,
165165
})),
166166
} as Parameters<typeof prompt>[0]);
167-
if (regions.length === 0) {
168-
printFailure(context, 'At least one region is required');
167+
if (regions.length < 2) {
168+
printFailure(context, 'Dual region requires at least two regions');
169169
process.exit(1);
170170
}
171171
parsedLocations = parseLocations(regions);

src/lib/buckets/set-migration.ts

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,31 @@ export default async function setMigration(options: Record<string, unknown>) {
3131
process.exit(1);
3232
}
3333

34-
if (disable) {
35-
const config = await getStorageConfig();
36-
const selectedOrg = getSelectedOrganization();
37-
const finalConfig = {
38-
...config,
39-
...(selectedOrg && !config.organizationId
40-
? { organizationId: selectedOrg }
41-
: {}),
42-
};
34+
if (
35+
disable &&
36+
(bucket !== undefined ||
37+
endpoint !== undefined ||
38+
region !== undefined ||
39+
accessKey !== undefined ||
40+
secretKey !== undefined)
41+
) {
42+
printFailure(
43+
context,
44+
'Cannot use --disable with --bucket, --endpoint, --region, --access-key, or --secret-key'
45+
);
46+
process.exit(1);
47+
}
4348

49+
const config = await getStorageConfig();
50+
const selectedOrg = getSelectedOrganization();
51+
const finalConfig = {
52+
...config,
53+
...(selectedOrg && !config.organizationId
54+
? { organizationId: selectedOrg }
55+
: {}),
56+
};
57+
58+
if (disable) {
4459
const { error } = await setBucketMigration(name, {
4560
dataMigration: { enabled: false },
4661
config: finalConfig,
@@ -63,15 +78,6 @@ export default async function setMigration(options: Record<string, unknown>) {
6378
process.exit(1);
6479
}
6580

66-
const config = await getStorageConfig();
67-
const selectedOrg = getSelectedOrganization();
68-
const finalConfig = {
69-
...config,
70-
...(selectedOrg && !config.organizationId
71-
? { organizationId: selectedOrg }
72-
: {}),
73-
};
74-
7581
const { error } = await setBucketMigration(name, {
7682
dataMigration: {
7783
enabled: true,

src/lib/buckets/set.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export default async function set(options: Record<string, unknown>) {
6363
if (
6464
access === undefined &&
6565
locations === undefined &&
66-
deprecatedRegion === undefined &&
6766
allowObjectAcl === undefined &&
6867
disableDirectoryListing === undefined &&
6968
cacheControl === undefined &&

src/specs.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ definitions:
1919
value: GLACIER_IR
2020
description: Lowest-cost storage for long-lived data that is rarely accessed and requires retrieval in milliseconds.
2121

22+
transition_tier_options: &transition_tier_options
23+
- name: Infrequent Access
24+
value: STANDARD_IA
25+
description: Lower-cost storage for data that is accessed less frequently but requires rapid access when needed.
26+
- name: Archive
27+
value: GLACIER
28+
description: Low-cost storage for data archiving. Long-term data archiving with infrequent access.
29+
- name: Instant Retrieval Archive
30+
value: GLACIER_IR
31+
description: Lowest-cost storage for long-lived data that is rarely accessed and requires retrieval in milliseconds.
32+
2233
consistency_options: &consistency_options
2334
- name: Default
2435
value: default
@@ -760,7 +771,7 @@ commands:
760771
- name: storage-class
761772
description: Target storage class to transition objects to
762773
alias: s
763-
options: *tier_options
774+
options: *transition_tier_options
764775
- name: days
765776
description: Transition objects after this many days
766777
alias: d

0 commit comments

Comments
 (0)