Comments (3)
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.
I'm able to reproduce this error. Tried running cmd in administrator mode but still get the same error as described.
from forge.
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)
- Publish a .dll on NuGet too? HOT 1
- forge.sh is not using mono on linux HOT 2
- Wrong `TargetFramework` version in project file HOT 3
- Build fails on Fedora with `The required attribute "Project" in Import is empty` HOT 1
- (Mac) Homebrew install fails with: <<-EOS.undent is disabled! HOT 1
- Forge deletes custom nodes from project files
- Forge 3.0 HOT 5
- vscode integration? HOT 1
- Migrate to FAKE 5 HOT 2
- Replace templating system with `dotnet new` HOT 1
- Support FAKE 5 runner with `forge fake` HOT 1
- "forge add project --help" Shows parameter information for adding references HOT 2
- (On Windows) Surround `Forge` command path with quotes against path with spaces HOT 1
- Exception when trying to add/remove files to/from F# Azure Functions projects HOT 2
- function isValidFileName is buggy
- Domain name expired HOT 1
- Move file to folder does not seem to work as expected HOT 2
- Unclear instructions for how to install from source on linux
- Docs improvement
- Deprecating Forge
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from forge.