Skip to content
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

feat: add support for file_size tag #85

Merged
merged 6 commits into from
Oct 16, 2022

Conversation

espenja
Copy link
Contributor

@espenja espenja commented Aug 28, 2022

Closes #70

Adds support for {file_size} as a tag.
Uses https://www.npmjs.com/package/file-size (0 dependencies) for human readable formatting.
Human readable formatting can be enabled by setting the config value rpc.fileSizeHumanReadable to true.
If rpc.fileSizeHumanReadable is set to false, B will be used to represent bytes instead, and the file size will be formatted with toLocaleString.

Example display:
image
With configuration:

{
  "rpc.fileSizeHumanReadable": true,
  "rpc.fileSizeSpec": "iec",
  "rpc.fileSizeFixed": 2,
  "rpc.detailsEditing": "In {workspace} {file_extension} {file_size}",
}

Default values for configuration is the default values for the dependency file-size.

@xhayper
Copy link
Collaborator

xhayper commented Oct 14, 2022

PR looks amazing, will test it it tomorrow

@xhayper xhayper added the enhancement New feature or request label Oct 14, 2022
@xhayper
Copy link
Collaborator

xhayper commented Oct 15, 2022

could you resolve the merge conflict?

@espenja
Copy link
Contributor Author

espenja commented Oct 15, 2022

@xhayper Should be resolved now

@xhayper
Copy link
Collaborator

xhayper commented Oct 16, 2022

Amazing work! Thank you!

@xhayper xhayper merged commit f829ca3 into leonardssh:main Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ${file_size}
2 participants