iiewad
(iewad)
8 Diciembre, 2021 03:35
1
require 'sshkey'
remote = 'git@github.com:private/theme_name.git' # Repositorio privado de Github para el tema de discourse
theme_user = Discourse.system_user
private_key = SSHKey.generate.private_key
branch = 'main'
RemoteTheme.import_theme(remote, theme_user, private_key: private_key, branch: branch)
Errno::ENOENT: No such file or directory - timeout
from /Users/foo/.rbenv/versions/2.7.2/lib/ruby/2.7.0/open3.rb:213:in `spawn'`
def commits_since(hash)
commit_hash, commits_behind = nil
commit_hash = execute("git", "rev-parse", "HEAD").strip
commits_behind = execute("git", "rev-list", "#{hash}..HEAD", "--count").strip rescue -1
[commit_hash, commits_behind]
end
def version
execute("git", "rev-parse", "HEAD").strip
end
def cleanup!
FileUtils.rm_rf(@temp_folder)
end
def real_path(relative)
fullpath = "#{@temp_folder}/#{relative}"
return nil unless File.exist?(fullpath)
→
if !unsafe_shell && (command.length == 1) && command[0].include?(" ")
# Sending a single string to Process.spawn will launch a shell
# This means various things (e.g. subshells) are possible, and could present injection risk
raise "Arguments should be provided as separate strings"
end
if timeout
# will send a TERM after timeout
# will send a KILL after timeout * 2
command = ["timeout", "-k", "#{timeout.to_f * 2}", timeout.to_s] + command
end
args = command
args = [env] + command if env
stdout, stderr, status = Open3.capture3(*args, chdir: chdir)
if !status.exited? || !success_status_codes.include?(status.exitstatus)
failure_message = "#{failure_message}\n" if !failure_message.blank?
raise "#{caller[0]}: #{failure_message}#{stderr}"
end
Encontré que Mac no soporta el comando timeout
sam
(Sam Saffron)
8 Diciembre, 2021 06:27
2
macos, timeout
intenta brew install coreutils
2 Me gusta
iiewad
(iewad)
8 Diciembre, 2021 07:04
3
Gracias, puedo resolverlo con coreutils. ¡Creo que necesito lanzar este error e intentar dar un recordatorio de error mucho mejor!
system
(system)
Cerrado
2 Septiembre, 2025 11:09
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.