Giter VIP home page Giter VIP logo

Comments (3)

jindraivanek avatar jindraivanek commented on May 18, 2024 1

I did some digging on this. It looks like new file works only when runned inside project subdirectory. In more detail, Forge now does:

  • copy template file into current directory with new name
  • open project - it assumes fsproj path is in --project parameter (this is where OP example throw exception)
  • add new file to project

What I think new file --project <projectName> should do:

  • find subdirectory "projectName" with .fsproj in it
  • copy new file into that directory
  • add file into fsproj

If agreed, I can do this.

from forge.

andredublin avatar andredublin commented on May 18, 2024

I'm able to reproduce this error. Tried running cmd in administrator mode but still get the same error as described.

from forge.

Krzysztof-Cieslak avatar Krzysztof-Cieslak commented on May 18, 2024

I've added few integration tests to document current new file behavior. https://github.com/fsharp-editing/Forge/blob/master/tests/Forge.IntegrationTests/NewFileTests.fs

Essentially you need to pass relative path to file location, and relative path to fsproj. However project parameter is optional, if it's not provided we will try to find right project file. It should work well enough in most use cases.

Giving relative paths (relative to repository root, so directory where Forge should be run) is behavior we use for all other commands (add\remove file, project references etc) so wouldn't want to change it.

Also I've released fixed which will handle giving "wrong" project name (printing out warning + trying to find project file automatically), so this error shouldn't occur any more.

from forge.

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.