Popularity
3.1
Declining
Activity
0.0
Stable
9
0
3
Programming language: Crystal
License: MIT License
Tags:
Misc
shell.cr alternatives and similar shards
Based on the "Misc" category.
Alternatively, view shell.cr alternatives based on common mentions on social networks and blogs.
-
burocracia.cr
burocracia.cr the dependecyless shard to validate, generate and format Brazilian burocracias such as CPF, CNPJ and CEP -
crystal-web-framework-stars
Web frameworks for Crystal, most starred on Github
Get performance insights in less than 4 minutes
Scout APM uses tracing logic that ties bottlenecks to source code so you know the exact line of code causing performance issues and can get back to building a great product faster.
Sponsored
scoutapm.com
Do you think we are missing an alternative of shell.cr or a related project?
README
shell
Small simplistic helper class for executing shell commands in Crystal:
- run command,
- exit if it fails,
- return STDOUT of the command;
- optionally
- allow to ignore failure
- return STDERR of failed command.
Installation
Add this to your application's shard.yml
:
dependencies:
shell:
github: dmytro/shell.cr
Usage
require "shell"
Output of the shell command is available through #stdout
and #stderr
methods, numeric value of the exit status returned by the function #run
.
Simplest usage of the #run
method:
puts Shell.run("ls").stdout
If command fails Shell
raises exception, but this behaviour can be
overridden by fail_on_error
variable:
puts Shell.run("command_with_non_zero_status", fail_on_error: false).stderr
Contributing
- Fork it ( https://github.com/dmytro/shell/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- dmytro Dmytro Kovalov - creator, maintainer