.rake/utils.rb
# run executes the specified command using the shell, similar to sh. It adds
# support for providing env vars via a .env file, running the command silently,
# or running it via exec (to replace the current process).
run executes the specified command using the shell, similar to sh. It adds
support for providing env vars via a .env file, running the command silently,
or running it via exec (to replace the current process).
run executes the specified command using the shell similar to sh . It adds support for providing env vars via a . env file running the command silently or running it via exec ( to replace the current process ) .
def run(cmd, opts={})
  cmd = "sh -c '#{cmd.gsub("'"){%q{'"'"'}}}'"
  if opts[:env]
    sh "touch .env.local .env.test.local", verbose: false
    env = '.env'
    env += ".#{opts[:env]}" unless opts[:env] == :local
    cmd = "#{dotenv} -f #{env}.local,#{env} #{cmd}"
  end
  puts cmd if verbose == true
  if opts[:silent]
    out = `#{cmd} 2>&1`
    abort out unless $?.success?
  elsif opts[:exec]
    exec cmd
  else
    system(cmd)
  end
end
def run ( cmd , opts = { } ) cmd = "sh -c '#{cmd.gsub("'"){%q{'"'"'}}}'" if opts [ :env ] sh "touch .env.local .env.test.local" , verbose : false env = '.env' env += ".#{opts[:env]}" unless opts [ :env ] == :local cmd = "#{dotenv} -f #{env}.local,#{env} #{cmd}" end puts cmd if verbose == true if opts [ :silent ] out = ` #{ cmd }  2>&1 ` abort out unless $? . success? elsif opts [ :exec ] exec cmd else system ( cmd ) end end
run executes the specified command using the shell, similar to sh.
run executes the specified command using the shell similar to sh .
cmd
<not_specific>
opts
<not_specific>