This repository was archived by the owner on Jun 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 207
class ShopifyCli::Tunnel
Tim Anema edited this page Apr 22, 2020
·
9 revisions
PORT
DOWNLOAD_URLS
TIMEOUT
stop(ctx)
see source
# File lib/shopify-cli/tunnel.rb, line 22
def stop(ctx)
if ShopifyCli::ProcessSupervision.running?(:ngrok)
if ShopifyCli::ProcessSupervision.stop(:ngrok)
ctx.puts('{{green:x}} ngrok tunnel stopped')
else
ctx.abort('ngrok tunnel could not be stopped. Try running {{command:killall -9 ngrok}}')
end
else
ctx.puts("{{green:x}} ngrok tunnel not running")
end
end
start(ctx)
see source
# File lib/shopify-cli/tunnel.rb, line 34
def start(ctx)
install(ctx)
process = ShopifyCli::ProcessSupervision.start(:ngrok, ngrok_command)
log = fetch_url(ctx, process.log_path)
if log.account
ctx.puts("{{v}} ngrok tunnel running at {{underline:#{log.url}}}, with account #{log.account}")
else
ctx.puts("{{v}} ngrok tunnel running at {{underline:#{log.url}}}")
end
ctx.app_metadata = { host: log.url }
log.url
end
auth(ctx, token)
see source
# File lib/shopify-cli/tunnel.rb, line 47
def auth(ctx, token)
install(ctx)
ctx.system(File.join(ShopifyCli::ROOT, 'ngrok'), 'authtoken', token)
end
- SingleForwardable