[dev log] release of alfred-cli v2.2.1 - what's new
Version 2.2.1
of alfred is out.
I’m happy with the changes in this version. I’m even more excited for the next release which will fix a major issue and remove the dependency on plumbum. 2 articles are ready and will be publish next week. 2 articles are ready for week to come :
- how to plays a continuous integration pipeline for fast api and react in local with alfred
- how to stream and capture at the same time stdout and stderr in python on both linux and windows.
So what’s new on this version ?
This version gives the ability to invoke a fulltext command instead of composing it.
@alfred.command('lint', help="validate the source code using mypy")
def lint():
alfred.run("mypy src/*")
Before you would have had to write the following code.
@alfred.command('lint', help="validate the source code using mypy")
def lint():
mypy = alfred.sh('mypy')
alfred.run(mypy, ['src/*'])
The goal is to improve the developer experience. It’s easier to write commands for your first time, then change patterns when you hit limit. The commands run the same.
The command is not executed by a shell. The command alfred.run("mypy src/* > file.txt")
will fail with an error message. If you need this feature, leave a comment or vote for it.
The other changes
The working folder of a command, retrieved with os.cwd
, is always the project folder. This operation simplifies writing a command by avoiding thinking about where the user is invoking the command. If you need to retrieve the invocation folder in a command, you can use alfred.execution_directory
Bug fix, more the release note
You want to know more about Alfred, you can: