Merge pull request 'feat: add support for sshfs option (-o) in config' (#51) from feature/50-add-support-for-sshfs-options into develop
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #51
This commit is contained in:
commit
3a8d9239b2
3 changed files with 17 additions and 9 deletions
|
@ -31,6 +31,6 @@ Log.setup do |config|
|
|||
end
|
||||
end
|
||||
|
||||
app = GX::Cli.new
|
||||
app.parse_command_line(ARGV)
|
||||
app.run
|
||||
cli = GX::Cli.new
|
||||
cli.parse_command_line(ARGV)
|
||||
cli.run
|
||||
|
|
|
@ -13,6 +13,7 @@ module GX::Models
|
|||
getter remote_user : String = ""
|
||||
getter remote_host : String = ""
|
||||
getter remote_port : String = "22"
|
||||
getter options : Array(String) = [] of String
|
||||
|
||||
include Concerns::Base
|
||||
|
||||
|
@ -28,13 +29,19 @@ module GX::Models
|
|||
mount_point_safe = @mount_point
|
||||
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(
|
||||
"sshfs",
|
||||
[
|
||||
"-p", remote_port,
|
||||
"#{@remote_user}@#{@remote_host}:#{@remote_path}",
|
||||
mount_point_safe,
|
||||
],
|
||||
options,
|
||||
input: STDIN,
|
||||
output: STDOUT,
|
||||
error: STDERR
|
||||
|
@ -43,3 +50,4 @@ module GX::Models
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue