Git Product home page Git Product logo

Comments (6)

yevhen avatar yevhen commented on May 23, 2024

Oh, it's because you have a non-standard layout 😬

I actually check whether sample Nake runner files are present in solution root or not (https://github.com/yevhen/Nake/blob/master/Build/NuGet/Init.ps1#L7). But you solution file and nake runner files are not on the same level.

Well, I prefer to leave this logic. It's really convenient when you're installing Nake first time, the runner file and sample script will be automatically created. Easy to boot novices.

Have any other ideas how can we fix this?

from nake.

vansha avatar vansha commented on May 23, 2024

It's pretty standard layout, especially for enterprise projects :), where source code is just a part of it. On the source level we have things like database, documentation, etc. So Nake is at root directory as it deals not only with source code, while solution file in src.

Probably the right way of handling it is to utilize install.ps1 script - in that case it will run only once, after first install.

But I'd rather prefer a dirty hack, that would solve my problem, and seems to not harm others. Just adding one more check :)

$scriptDir      = split-path $script:MyInvocation.MyCommand.Path
$solutionDir    = (get-item $scriptDir ).parent.parent.parent.FullName
$mightBeRootDir = (get-item $solutionDir ).parent.FullName
$samplesDir     = Join-Path (get-item $scriptDir ).parent.FullName "sample"
$sampleCsxFile  = "Nake.csx" 
$sampleBatFile  = "Nake.bat" 

if ((Test-Path "$mightBeRootDir\Nake.csx") -or (Test-Path "$mightBeRootDir\Nake.bat")) {
    Exit
}

if ((Test-Path "$solutionDir\Nake.csx") -or (Test-Path "$solutionDir\Nake.bat")) {
    Exit
}

Write-Host "Copying sample script and runner to root folder ..." -ForegroundColor DarkYellow
Copy-Item "$samplesDir\$sampleCsxFile" $rootDir
Copy-Item "$samplesDir\$sampleBatFile" $rootDir

But it smells.

from nake.

yevhen avatar yevhen commented on May 23, 2024

I'm more inclined to go with Install.ps1 since Nake will be installed only once for solution.
But I need to test it. Will have a look after Easter!
Happy Easter, btw! :)

from nake.

vansha avatar vansha commented on May 23, 2024

from nake.

yevhen avatar yevhen commented on May 23, 2024

Install.ps1 won't run for solution-level packages :(
Including sample script and batch runner as content - make it project-level :(
Another solution could be is to put Readme.txt with instructions ...

from nake.

vansha avatar vansha commented on May 23, 2024

Closing issue as it was fixed a long time ago in 2d2f5c7 by using simple readme instead of Install.ps1. Thanks!

from nake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.