Skip to content

Instantly share code, notes, and snippets.

@amireh
Last active August 29, 2015 14:16
Show Gist options
  • Save amireh/09f9ce74f8f2ba85c64c to your computer and use it in GitHub Desktop.
Save amireh/09f9ce74f8f2ba85c64c to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
require "bundler/setup"
load Gem.bin_path("bridge_cli", "bridge_cli")
rescue LoadError
# no spring, we'll run the command directly
root = File.join(File.expand_path(File.dirname(__FILE__)), '..')
require File.join(root, 'config/environment.rb')
require File.join(root, 'config/boot.rb')
require_dependency "bridge_cli"
::Account.find_by(database: ENV["BRIDGE_CLI_DB"] || "bridge").use_tenant
::BridgeCLI::Base.start(ARGV)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment