foundweekends / foundweekends/giter8

"Skipping ignored file" warnings in case of conditional folder

Open
#932 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Scala
Stars
1.8k
Forks
225
Avg merge
2h 35m
Merged PRs (30d)
8

Description

## steps

This can be reproduced e.g. with `sbt new raquo/scalajs.g8` and then choosing `n` for CSS.

All you need is to have a non-empty conditional folder named like `$if(include_CSS.truthy)$.$endif$`, and for the condition to not match.

sbt or Giter8 version:

```
sbt --version
sbt version in this project: 1.10.2
sbt script version: 1.10.2
```

## problem

If the condition in the conditional folder is not satisfied, giter8 prints warnings like this:

```
sbt new file:///Users/raquo/code/scala/scalajs-laminar.g8
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
name [my-app]: demo
package [example]:
dev_server_port [3333]:
include_laminar [Y/n]: y
include_CSS [Y/n]: n
Skipping ignored file: /var/folders/m5/7v96psjx2djg62n0zjd_93f00000gn/T/giter8-315401690193583/src/main/g8/$if(include_CSS.truthy)$.$endif$/style.css
Skipping ignored file: /var/folders/m5/7v96psjx2djg62n0zjd_93f00000gn/T/giter8-315401690193583/src/main/g8/src/main/scala/$package$/$if(include_laminar.truthy)$.$endif$/$if(include_CSS.truthy)$.$endif$/HelloWorld.less
Skipping ignored file: /var/folders/m5/7v96psjx2djg62n0zjd_93f00000gn/T/giter8-315401690193583/src/main/g8/src/main/scala/$package$/$if(include_laminar.truthy)$.$endif$/$if(include_CSS.truthy)$.$endif$/Main.less

Template applied in /Users/raquo/code/scala/TEST/./demo
```

## expectation

Folder condition not matching is not a problem or an edge case, it's normal operation, so there should be no warnings.

The warnings look like errors indicating a problem, especially to newbies who are likely to use these giter8 templates.

## notes

The error is printed [here](https://github.com/foundweekends/giter8/blob/368296607f80317dfb9addcb8a8aaf8560c3bc72/library/src/main/scala/g8.scala#L507-L508). Not sure if there are any other usages of this log, or if it could just be replaced with `.foreach`.

Screenshot 2024-12-08 at 5 41 05 AM

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.