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

Allow nu to run correctly even if the current working directory is the managed lib folder #10

Open
brendanjerwin opened this issue Sep 1, 2010 · 4 comments

Comments

@brendanjerwin
Copy link

We could perhaps move the nuniverse.yaml file into the lib folder too. The algorithm would be for Nu to look in the current directory first, then if it doesn't find it, try one above, if not then, try all the sub dirs.

If not any of those we should probably bail.

@drusellers
Copy link

I would just walk down the file system looking for the directory/file that we need.

@brendanjerwin
Copy link
Author

From Keith Dahlby on nu-net:

I'm pretty sure Git just uses brute force, like we do in PowerShell for posh-git:

function Get-LocalOrParentPath($path) {
    $checkIn = Get-Item .

    while ($checkIn -ne $NULL) {
        $pathToTest = [System.IO.Path]::Combine($checkIn.fullname, $path)
        if (Test-Path $pathToTest) {

            return $pathToTest
        } else {
            $checkIn = $checkIn.parent

        }
    }
    return $null
}

@ferventcoder
Copy link

Does "nu lib ." work?

@brendanjerwin
Copy link
Author

I suppose it would, although now it'd be nu config lib.location ..
It wouldn't quite cover the behavior, but it might be close enough for some needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants