Run from Lib

0 views
Skip to first unread message

brendanjerwin

unread,
Aug 26, 2010, 8:23:38 AM8/26/10
to nu-net
I'd like to be able to run nu while the current directory is the nu
managed lib directory.

I envision that we can write a .nu directory in the lib and that .nu
can contain a marker indicating that it is in the lib directory. Then
nu would just do the right thing.

Thoughts?

Dru Sellers

unread,
Sep 1, 2010, 4:09:58 PM9/1/10
to nu-...@googlegroups.com
make it so!
it could 'error' if it is NOT in a 'nu' project
-d

Brendan Erwin

unread,
Sep 1, 2010, 5:08:49 PM9/1/10
to nu-...@googlegroups.com
http://github.com/nu/nu/issues/issue/10

Anyone know the Git algorithm?

Keith Dahlby

unread,
Sep 1, 2010, 5:21:44 PM9/1/10
to nu-...@googlegroups.com
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
}
Reply all
Reply to author
Forward
0 new messages