-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PE-7109: feat(cli) add custom Arweave tags support #216
PE-7109: feat(cli) add custom Arweave tags support #216
Conversation
- Add tags option to CLI for specifying custom Arweave tags - Implement tag parsing utility for CLI input format (name/value pairs) - Update upload file options to include tags parameter - Add types for tag support in UploadFileOptions - Forward parsed tags to upload methods Example usage: turbo upload-file --tags Content-Type image/png App-Name MyApp
Seems like rogue file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this?
CHANGELOG.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to rebase if this is here?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## alpha #216 +/- ##
=======================================
Coverage 93.40% 93.40%
=======================================
Files 25 25
Lines 3562 3562
Branches 161 161
=======================================
Hits 3327 3327
Misses 235 235 ☔ View full report in Codecov by Sentry. |
src/cli/utils.ts
Outdated
|
||
const tags: { name: string; value: string }[] = []; | ||
|
||
for (let i = 0; i < tagsArr.length; i += 2) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to change this but another way to do this in fewer lines of code:
while(a.length) {
const tag = { name: tagsArr.shift(), value: tagsArr.shift() };
if (tag.name === undefined || tag.value === undefined) {
throw new Error(
'Invalid tag format. Each tag must have both a name and value.',
);
}
tags.push(tag);
}
While loops can be risky but the risks are pretty contained here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QUICK NOTE: Empty strings are falsey in js. Double check on the validity of empty tag names and values.
tags: { | ||
description: | ||
'An array of additional tags for the write action, in "--tags name1 value1 name2 value2" format', | ||
alias: '--tags <tags...>', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the correct use of alias? Seems like no alias is being assigned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Derek Sonnenberg <derek@ardrive.io>
- Add tags option to upload commands - Integrate tag support in uploadFile and uploadFolder commands - Add tags to UploadOptions interface
…tent-type' of github.com:ardriveapp/turbo-sdk into PE-7109-upload-file-turbo-cli-allow-custom-tags-and-content-type
…tags-and-content-type
🎉 This PR is included in version 1.22.0-alpha.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.22.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Example usage: