Sha256: 98eb854031be2a9ae61b8c59aa2a3ebb492816c825f704be402b46be2c2fe7eb

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

#!/usr/bin/env ruby

require "smart_machine"

command = ARGV.shift

machine = SmartMachine::Machine.new

case command
when "new"
	machine.create ARGV
	return

when "--init-local"
	machine.init_local ARGV
	return

when "--version"
	puts "SmartMachine #{SmartMachine.version}"
	return

when "--help"
	puts "Help: Specify a valid smartmachine command to execute. Are you in the correct directory to run this command?"
	return

when "runner"
	exec "smartrunner #{ARGV.join(' ')}"
	return

end

if machine.in_local_machine_dir?
	case command
	when "credentials:edit"
		credentials = SmartMachine::Credentials.new
		credentials.edit

	when "environment:edit"
		system("#{ENV['EDITOR']} config/environment.rb")

	when "users:edit"
		system("#{ENV['EDITOR']} config/users.yml")

	when "ssh"
		machine.ssh

	when "install"
		machine.installer ARGV.unshift("install")

	when "update"
		machine.installer ARGV.unshift("update")

	when "uninstall"
		machine.installer ARGV.unshift("uninstall")

	when "apps"
		machine.apps ARGV

	when "grids"
		machine.grids ARGV
		return

	when "ps"
		machine.ps ARGV
		return

	when "logs"
		machine.logs ARGV
		return

	when "sync"
		sync = SmartMachine::Sync.new
		sync.run

	else
		exec "smartmachine --help"

	end
else
	exec "smartmachine --help"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
smartmachine-0.8.0 bin/smartmachine
smartmachine-0.7.0 bin/smartmachine