Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix uses of .exit_status to prefer .exit_code. #119

Merged
merged 1 commit into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/savi/compiler/binary.cr
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ class Savi::Compiler::Binary
link_args << "-o" << ctx.options.binary_name

res = Process.run("/usr/bin/env", link_args, output: STDOUT, error: STDERR)
raise "linker failed" unless res.exit_status == 0
raise "linker failed" unless res.exit_code == 0

if ctx.options.release
res = Process.run("/usr/bin/env", ["strip", ctx.options.binary_name], output: STDOUT, error: STDERR)
raise "strip failed" unless res.exit_status == 0
raise "strip failed" unless res.exit_code == 0
end
ensure
File.delete(obj_filename) if obj_filename
Expand Down
6 changes: 3 additions & 3 deletions src/savi/compiler/binary_verona.cr
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,18 @@ class Savi::Compiler::BinaryVerona
link_args << "-o" << ctx.options.binary_name

res = Process.run("/usr/bin/env", link_args, output: STDOUT, error: STDERR)
raise "linker failed" unless res.exit_status == 0
raise "linker failed" unless res.exit_code == 0

if ctx.options.release
res = Process.run("/usr/bin/env", ["strip", ctx.options.binary_name], output: STDOUT, error: STDERR)
raise "strip failed" unless res.exit_status == 0
raise "strip failed" unless res.exit_code == 0
end
ensure
File.delete(obj_filename) if obj_filename
end

def self.run_last_compiled_program
res = Process.run("/usr/bin/env", ["./" + Compiler::CompilerOptions::DEFAULT_BINARY_NAME], output: STDOUT, error: STDERR)
res.exit_status
res.exit_code
end
end
2 changes: 1 addition & 1 deletion src/savi/compiler/eval.cr
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ class Savi::Compiler::Eval
binary_path = "./#{ctx.options.binary_name}"

res = Process.run("/usr/bin/env", [binary_path], output: STDOUT, error: STDERR)
@exitcode = res.exit_status
@exitcode = res.exit_code
end
end