An open API service indexing awesome lists of open source software.

https://github.com/pr0ngledev/commands

A crystal shard for simple, skiddie friendly UNIX command execution
https://github.com/pr0ngledev/commands

commands crystal crystal-lang

Last synced: about 1 year ago
JSON representation

A crystal shard for simple, skiddie friendly UNIX command execution

Awesome Lists containing this project

README

          

# commands

commands is a Skiddie-friendly Crystal Shard to make it easier to execute commands.

## Installation

1. Add the dependency to your `shard.yml`:

```yaml

dependencies:

commands:

github: Pr0ngleDev/commands

```

2. Run `shards install`

## Usage

```crystal
require "commands"
```





execCommand can be used to execute a bash command and receive its output

```crystal
.execCommand("Hello World") # Returns Hello World
```




execProscess can be used to execute a bash command and recieve its error code

``` crystal
.execProcess("echo Hello World") # Returns 0
```




## Examples


``` crystal
foo = .executeCommand("echo foo")
puts foo
```
This would print foo to the stdout


```crystal
foo = .executeCommand("echo haha")
puts foo.reverse
```
This would print ahah to the stdout

## Contributors

- [Prongle](https://github.com/Pr0ngleDev) - creator and maintainer