iiewad
(iewad)
Dezembro 8, 2021, 3:35am
1
require 'sshkey'
remote = 'git@github.com:private/theme_name.git' # Repositório privado do Github para o tema do 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
Descobri que o Mac não suporta o comando timeout
sam
(Sam Saffron)
Dezembro 8, 2021, 6:27am
2
macos, timeout
tente brew install coreutils
2 curtidas
iiewad
(iewad)
Dezembro 8, 2021, 7:04am
3
Obrigado, consigo resolver com coreutils. Acho que preciso lançar este erro e tentar dar um lembrete de erro muito melhor!
system
(system)
Fechado
Setembro 2, 2025, 11:09am
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.