9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/snapshot_ui/cli.rb', line 9
def live(initializer_file)
unless File.exist?(initializer_file)
puts "The provided initializer file `#{initializer_file}` doesn't exist. Please double check the path."
exit 1
end
load initializer_file
websocket_host_uri = URI.parse(SnapshotUI.configuration.live_websocket_url)
websocket_host_uri.path = ""
config_path = Pathname.new(__dir__).join("cli", "watcher.ru").cleanpath.to_s
exec "SNAPSHOT_UI_INITIALIZER_FILE=#{initializer_file} bundle exec falcon serve --bind #{websocket_host_uri} --count 1 --config #{config_path}"
end
|