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

Add pdu version to JSON #28

Closed
KSXGitHub opened this issue Jun 4, 2021 · 6 comments · Fixed by #31
Closed

Add pdu version to JSON #28

KSXGitHub opened this issue Jun 4, 2021 · 6 comments · Fixed by #31
Assignees
Labels
enhancement New feature or request json

Comments

@KSXGitHub
Copy link
Owner

No description provided.

@Byron
Copy link
Contributor

Byron commented Jun 5, 2021

Maybe not the right ticket, apologies, but would it be possible to get a valid path for the traversal roots? Currently there would be no way to construct paths for deletion. For instance "dev" could be "/Users/byron/dev" as passed to pdu.

➜  dua-cli git:(main) pdu --version
pdu 0.4.0
➜  dua-cli git:(main) pdu --json-output   ~/dev | jq .
{
  "unit": "Bytes",
  "tree": {
    "name": "dev",
    "data": 99192443577,
    "children": [
      {
       

@KSXGitHub
Copy link
Owner Author

KSXGitHub commented Jun 5, 2021

How about adding a "root" "cwd" field to the top-level of the JSON?

@KSXGitHub
Copy link
Owner Author

Actually, forget about "cwd", would #30 be sufficient?

@Byron
Copy link
Contributor

Byron commented Jun 5, 2021

Absolutely - anything that allows to construct a valid filesystem path. cwd should do and would probably be /Users/byron in the example above.

KSXGitHub added a commit that referenced this issue Jun 5, 2021
@KSXGitHub
Copy link
Owner Author

I just find a more elegant solution: Just display the root path as it was provided from the CLI (1383195).

  • pdu should display . as root.
  • pdu /Users/byron/dev should display /Users/byron/dev as root (it was just dev before).
  • pdu $(pwd) should display full path of current directory as root.

@KSXGitHub
Copy link
Owner Author

v0.5.0 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request json
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants