ProjectScaffold icon indicating copy to clipboard operation
ProjectScaffold copied to clipboard

Unable to parse template file paket.template No indented block following name 'tags' line 10.

Open aureole82 opened this issue 9 years ago • 2 comments

Starting the build script the first time the following message comes up:

# NOTE: Aside from the Project Name, you may leave any
# of these blank, but you will need to change the defaults
# in the generated scripts.

So I left the tags field empty. Unfortunately the release process needs it:

Starting Target: NuGet (==> All)
C:\...\ProjectScaffold-master\.paket\paket.exe pack output bin version  1.0.2 releaseNotes  "
SourceLink removed since it throws errors."
Paket version 1.3.3.0
Paket failed with:
        Unable to parse template file C:\...\ProjectScaffold-master\src\test\paket.template:
No indented block following name 'tags' line 10.
Running build failed.
Error:
System.Exception: Error during packing ..
   bei [email protected](String message) in C:\code\fake\src\app\FakeLib\PaketHelper.fs:Zeile 68.
   bei Fake.Paket.Pack(FSharpFunc`2 setParams) in C:\code\fake\src\app\FakeLib\PaketHelper.fs:Zeile 68.
   bei [email protected](Unit _arg9) in C:\...\ProjectScaffold-master\build.fsx:Zeile 181.
   bei Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:Zeile 411.

Are tags mandatory for publishing NuGet packages?

aureole82 avatar May 04 '15 12:05 aureole82

I can reproduce this error by also leaving the tags empty. A bit of experimentation showed the following:

  • If Paket sees a "tags" line followed by an "empty" line in paket.template (that is, four spaces with no text after them, which is what gets produced by the init.fsx script when you leave the tags empty), this error occurs.
  • If the "tags" line, and the spaces-only line that follows it, are removed, Paket runs without complaining.
  • If the "tags" line and its following spaces-only line are commented out, Paket also runs without complaining.

I suggest that if the user presses Enter (without typing in anything) during any part of the init.fsx question script, so that the corresponding field (like "tags") is empty, the paket.template file should be generated with that line present but commented out. With, perhaps, a suitable sample to show how it should be populated once the user uncomments it. E.g., if the user doesn't select any tags, then this is how the "tags" section of paket.template gets written:

# Tags should be space-separated.
#tags
#    tag1 tag2 tag3

rmunn avatar Sep 05 '16 08:09 rmunn

@rmunn

I suggest that if the user presses Enter (without typing in anything) during any part of the init.fsx question script, so that the corresponding field (like "tags") is empty, the paket.template file should be generated with that line present but commented out. With, perhaps, a suitable sample to show how it should be populated once the user uncomments it. E.g., if the user doesn't select any tags, then this is how the "tags" section of paket.template gets written:

Can you send a PR for that? thanks

dsyme avatar Jun 08 '17 01:06 dsyme