diff --git a/lib/twenty/libexec.rb b/lib/twenty/libexec.rb new file mode 100644 index 0000000..b00deda --- /dev/null +++ b/lib/twenty/libexec.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +def spawn(exec, *argv) + libexec_dir = File.realpath(File.join(__dir__, "..", "..", "libexec", "twenty")) + Process.spawn File.join(libexec_dir, exec), *argv +end + +def wait(pid) + Process.wait(pid) +rescue Interrupt + retry +end diff --git a/libexec/twenty/connect b/libexec/twenty/connect index e69de29..f75e2d0 100644 --- a/libexec/twenty/connect +++ b/libexec/twenty/connect @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +## +# main +def main(argv) + Twenty::Command::Connect.new(argv).run +end +main(ARGV) diff --git a/libexec/twenty/disconnect b/libexec/twenty/disconnect index e69de29..cbf9521 100644 --- a/libexec/twenty/disconnect +++ b/libexec/twenty/disconnect @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +## +# main +def main(argv) + Twenty::Command::Disconnect.new(argv).run +end +main(ARGV) diff --git a/libexec/twenty/down b/libexec/twenty/down index e69de29..a933344 100644 --- a/libexec/twenty/down +++ b/libexec/twenty/down @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +## +# main +def main(argv) + Twenty::Command::Down.new(argv).run +end +main(ARGV) diff --git a/libexec/twenty/up b/libexec/twenty/up index e69de29..f4eb898 100644 --- a/libexec/twenty/up +++ b/libexec/twenty/up @@ -0,0 +1,9 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +## +# main +def main(argv) + Twenty::Command::Up.new(argv).run +end +main(ARGV)