System module with methods for executing commands and handling files
Open Issues: 0
- php: ^7.2
- recipe-runner/recipe-runner: 1.0.x-dev
- symfony/filesystem: ^4.3
- symfony/process: ^4.3
- yosymfony/collection: ^1.1
- mikey179/vfsstream: ^1.6
- phpunit/phpunit: ^7
This package is auto-updated.
Last update: 2023-03-14 22:31:28 UTC
- PHP +7.2
- Recipe Runner
Create a recipe and add the module to the
name: "Your recipe" extra: rr: packages: "recipe-runner/system-module": "1.0.x-dev"
Executes a command.
steps: - actions: - run: "echo hi user"
A command could be split into command and parameters. This way, parameters will be escaped automatically.
steps: - actions: run: command: "echo" # Command "hi user" # parameter 1
You can also set a timeout and the current working directory
steps: - actions: - run: command: "echo hi user" timeout: 60 cwd: "/temp"
Makes a copy of a single file.
steps: - actions: - copy_file: from: "/dir1/file.txt" to: "/tmp/file.txt"
Download a file from network.
steps: - actions: - download_file: url: "https://phar.phpunit.de/phpunit-8.phar" filename: "phpunit.phar"
Makes a directory recursively. On POSIX filesystems, directories are created with a default mode value 0777.
steps: - actions: - make_dir: "/dir1"
or you can set the directory mode with the parameter
steps: - actions: - make_dir: dir: "/dir1" mode: 0777
Copies all the contents of the source directory into the target one.
steps: - actions: - mirror_dir: from: "/dir1" to: "/tmp"
Reads the content of a file or URL address.
steps: - actions: - read_file: "/tmp/hi.txt" register: "file_content"
File content available at
registered["file_content"]["content"] ## or registered.get('file_content.content')
Deletes files, directories and symlinks.
steps: - actions: - remove: "/tmp/hi.txt"
steps: - actions: - remove: - "/tmp/hi.txt" - "/dir1" - "/home/user/symlink1.sh"
Saves the given contents into a file.
steps: - actions: - write_file: filename: "/tmp/hi.txt" content: "hi user"
For module developers
The preferred installation method is Composer:
composer require recipe-runner/system-module
You can run the unit tests with the following command:
$ cd system-module $ composer test
This library is open-sourced software licensed under the MIT license.