exec

Basic Shell-like, async by default, command execution with no shell interpreter invocation process
0.4.1 Latest release released
j8r/exec.cr
4
Julien Reichardt

This repo seems to be no longer available at j8r/exec.cr.

Git synchronization failed . Last successful sync was .

Help find it again! … or have it archived.

Exec

Basic Shell-like, async by default, command execution with no shell interpreter invocation.

Installation

Add the dependency to your shard.yml:

dependencies:
  exec:
    github: j8r/exec.cr

Usage examples

Adding .wait (API reference) allow to have sync execution.

Shell-like syntax. The command and its arguments are merged in a single String.

output, error = Exec.run "echo hello", { |process| puts process.wait.success? } #=> true
puts output.to_s #=> hello

Most efficient syntax: command as String and arguments as Array(String)

Exec.new "/bin/true", &.wait
Exec.new("/bin/ls", ["/tmp", "-l"]) {}

Arguments can also be a separated String. This is bit more efficient than being merged in a single string with the command.

Exec.run("/bin/ls", "/tmp -l")

License

Copyright (c) 2017-2019 Julien Reichardt - ISC License

exec:
  github: j8r/exec.cr
  version: ~> 0.4.1
License ISC
Crystal none

Authors

Dependencies 0

Development Dependencies 0

Dependents 1

Last synced .
search fire star recently