Can't make most basic Sourcery template work

I'm trying to use Sourcery to generate an app secrets file for build automation, as documented in more than one place online. But the most basic of Sourcery commands seems to not substitute args. I'm invoking it like this:

/usr/local/bin/sourcery  --output ServiceKeysTest.gitignore.swift --templates ServiceKeysTemplate.stencil --args foo=bar --sources .

My template is:

struct
Something
{
	let	foo				=	"{{ foo }}"
}

But the result I'm getting is

// Generated using Sourcery 1.6.0 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT

struct
Something
{
	let	foo				=	""
}

What am I missing? I can't find a simple example like this in the docs anywhere.

I finally downloaded the source code and stepped through it to find where it sets this up. The key is to prefix the argument with argument.. I had tried arguments, but that didn’t work, and in the getting started docs this wasn't clear. I finally found it after very carefully re-examining Usage Reference

Terms of Service

Privacy Policy

Cookie Policy