Git Product home page Git Product logo

Comments (10)

davidB avatar davidB commented on May 24, 2024

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.

ark- avatar ark- commented on May 24, 2024

Thanks I'll try this. I tried with double quotes but didn't try single. Will report back.

from ffizer.

ark- avatar ark- commented on May 24, 2024

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.

davidB avatar davidB commented on May 24, 2024

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.

ark- avatar ark- commented on May 24, 2024

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.

davidB avatar davidB commented on May 24, 2024

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.

ark- avatar ark- commented on May 24, 2024

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.

davidB avatar davidB commented on May 24, 2024

Thanks for the feedback

from ffizer.

davidB avatar davidB commented on May 24, 2024

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.

davidB avatar davidB commented on May 24, 2024

fixed with ffizer 2.1+

from ffizer.

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.