Skip to content

nu::fs layer | Good beginner issue #3199

Closed

Description

@LhKipp

Currently our implementation uses std::fs::* and std::env::* to interact with the filesystem / environment. The problem is, that std::fs::* / std::env::* returns io::Result, while Nushell has its own error type. That leads to either everyone automatically returning the error in a ShellError::untagged_runtime_error() (little ugly), or write a custom conversion.

I would like to have a simple lib, wrapping std::fs, std::env, so we don't come up with 20 different error messages.

This would be best implemented in a new crate (we keep them under crates/). Copying the Cargo.toml file of nu-value-ext could be a good starting point.

I don't need a wrapper around whole std::fs, std::env. Read, write, current_dir, canonicalize would be sufficient for the start.

There is already a wrapper around canonicalize in nu-engine/src/filesystem/path.rs. However it returns io::Error. This function could potentially be moved into nu::fs.

Feel free to ask me for help, if needed, in our Discord (@LhKipp)

Activity

  1. github-actions commented on Jun 24, 2021

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

  2. github-actions commented on Jul 8, 2021

    @github-actions

    This issue has been marked stale for more than 10 days without activity. Closing this issue, but if you find that the issue is still valid, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions