Compare commits
No commits in common. "3a8d9239b2f3c8481cdd495bb0b26d0c7d403cec" and "37710103ec57fcfd942e607d884fe13cc0cae744" have entirely different histories.
3a8d9239b2
...
37710103ec
3 changed files with 9 additions and 17 deletions
|
@ -16,7 +16,7 @@ module GX
|
||||||
class Cli
|
class Cli
|
||||||
Log = ::Log.for("cli")
|
Log = ::Log.for("cli")
|
||||||
|
|
||||||
@config : GX::Config
|
@config : GX::Config
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
# Main execution starts here
|
# Main execution starts here
|
||||||
|
|
|
@ -31,6 +31,6 @@ Log.setup do |config|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
cli = GX::Cli.new
|
app = GX::Cli.new
|
||||||
cli.parse_command_line(ARGV)
|
app.parse_command_line(ARGV)
|
||||||
cli.run
|
app.run
|
||||||
|
|
|
@ -13,7 +13,6 @@ module GX::Models
|
||||||
getter remote_user : String = ""
|
getter remote_user : String = ""
|
||||||
getter remote_host : String = ""
|
getter remote_host : String = ""
|
||||||
getter remote_port : String = "22"
|
getter remote_port : String = "22"
|
||||||
getter options : Array(String) = [] of String
|
|
||||||
|
|
||||||
include Concerns::Base
|
include Concerns::Base
|
||||||
|
|
||||||
|
@ -29,19 +28,13 @@ module GX::Models
|
||||||
mount_point_safe = @mount_point
|
mount_point_safe = @mount_point
|
||||||
raise InvalidMountpointError.new("Invalid mount point") if mount_point_safe.nil?
|
raise InvalidMountpointError.new("Invalid mount point") if mount_point_safe.nil?
|
||||||
|
|
||||||
options = [] of String
|
|
||||||
# merge sshfs options
|
|
||||||
@options.each do |option|
|
|
||||||
options.push("-o", option)
|
|
||||||
end
|
|
||||||
options.push("-p", remote_port)
|
|
||||||
options.push(
|
|
||||||
"#{@remote_user}@#{@remote_host}:#{@remote_path}",
|
|
||||||
mount_point_safe
|
|
||||||
)
|
|
||||||
process = Process.new(
|
process = Process.new(
|
||||||
"sshfs",
|
"sshfs",
|
||||||
options,
|
[
|
||||||
|
"-p", remote_port,
|
||||||
|
"#{@remote_user}@#{@remote_host}:#{@remote_path}",
|
||||||
|
mount_point_safe,
|
||||||
|
],
|
||||||
input: STDIN,
|
input: STDIN,
|
||||||
output: STDOUT,
|
output: STDOUT,
|
||||||
error: STDERR
|
error: STDERR
|
||||||
|
@ -50,4 +43,3 @@ module GX::Models
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue