Comments (10)
yaml doesn't like {{
as is try with quotes
ignores:
- .git # exclude .git of the template host
- '{{#unless (eq BIN_TYPE "fast")}}**/fast.bin{{/unless}}'
(I didn't know about unless
block)
from ffizer.
Thanks I'll try this. I tried with double quotes but didn't try single. Will report back.
from ffizer.
Still doesn't like the string even in single quotes. See error below:
Jun 01 09: 13: 21.377 ERRO failed,
cmd: CliOpts {
verbose: 0,
cmd: Apply(ApplyOpts {
confirm: Never,
update_mode: Ask,
no_interaction: false,
offline: false,
src: SourceLoc {
uri: SourceUri {
raw: "run-template",
path: "run-template",
host: None
},
rev: "master",
subfolder: None
},
dst_folder: "test-output"
})
}, error: SerdeYaml {
source: Message("invalid value: string \"{{#unless (eq BIN_TYPE \\\"fast\\\")}}**/fast.bin{{/unless}}\", expected valid path matcher",
Some(Pos {
marker: Marker { index: 813, line: 29, col: 4
},
path: "ignores[1]"
}))
}
from ffizer.
I made a crappy fix, but I'm refactoring the way to read .ffizer.yaml
to fix it in a cleaner way (+ some other future extension). I'll do a release 2.0.0.betaX later this week including the fix.
from ffizer.
Nice, thank you! Unfortunately your current fix isn't working for me but I'll keep an eye on this issue until you do a proper refactor on the .ffizer.yaml. No point fixing a quickfix when you're going to change things anyway.
from ffizer.
I released with the fix (and the refactor) 2.0.0-beta.3. You can see the sample at https://github.com/ffizer/ffizer/blob/master/tests/data/test_7_ignores/template/.ffizer.yaml
The correct syntax for your case should be:
ignores:
- .git # exclude .git of the template host
- "{{#unless (eq BIN_TYPE 'fast')}}**/fast.bin{{/unless}}"
from ffizer.
I've only recently had a chance to check this fix and it does work. If you want to keep this comment open until you do your planned refactor that's OK but feel free to close it too.
from ffizer.
Thanks for the feedback
from ffizer.
Reopen because the root cause of the issue was not fixed.
To reproduced, update the sample 7 with:
variables:
- name: v
default_value: fast
ignores:
- .git # exclude .git of the template host
# - '{{#unless (eq v "fast")}}file3.txt{{/unles}}' #do not work
- '{{#if (eq v "fast")}}file2.txt{{/if}}'
- '{{#if (ne v "fast")}}file1.txt{{/if}}'
- '{{#if (ne v "slow")}}dir1/file4.txt{{/if}}'
- "{{v}}"
with layout
tests/data/template_7_ignores
├── .ffizer.samples.d
│ └── my-project.expected
│ ├── dir1
│ │ └── file5.txt
│ ├── file1.txt
│ └── file3.txt
├── .ffizer.yaml
├── dir1
│ ├── file4.txt
│ └── file5.txt
├── fast
├── file1.txt
├── file2.txt
└── file3.txt
4 directories, 10 files
and run cargo run -- test-samples -s tests/data/template_7_ignores
from ffizer.
fixed with ffizer 2.1+
from ffizer.
Related Issues (20)
- list of templates
- error with composed repositories HOT 5
- VSCode extension HOT 3
- keep variables value between 2 `apply` HOT 1
- find a way to isolate "example" part from a template to avoid re-apply it
- use git cli when available and fallback to libgit2 HOT 1
- create a plugin to use ffizer with backstage as scaffolder
- memorise what version of template was applied HOT 1
- add shell completion
- failed when convert into json empty (non existing) `{{ input_content }}` HOT 1
- provide parameter or function to format yaml following some rules
- allow to define the default value for applying script
- show command & output when apply script HOT 2
- run test on sample like a snapshot-test tool
- Use ffizer as a linter
- Issue with JSON schema for variable hidden
- support shortcut for command and url
- try to port a cookiecutter template
- add to how-to
- Improve no interaction mode
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 ffizer.