Skip to content
Permalink
Browse files

[js] Use uname op for sysname and release

Uses the new uname op for sysname and release info. version and machine are not exposed in node, and thus still shell out to uname.
  • Loading branch information...
ugexe committed Mar 31, 2019
1 parent f26fbd3 commit 0ecd037b7d51de95702a1b371d5694a7e6e0a3f0
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/core/Kernel.pm6
@@ -9,27 +9,27 @@ class Kernel does Systemic {
has Str $!arch;
has Int $!bits;

#?if moar
#?if !jvm
has $!uname;
method !uname {
$!uname ?? $!uname !! ($!uname := nqp::uname())
}
#?endif

method !uname-s {
#?if moar
#?if !jvm
nqp::atpos_s(self!uname, nqp::const::UNAME_SYSNAME)
#?endif
#?if !moar
#?if jvm
try shell('uname -s', :out, :!err).out.slurp(:close).chomp;
#?endif
}

method !uname-r {
#?if moar
#?if !jvm
nqp::atpos_s(self!uname, nqp::const::UNAME_RELEASE)
#?endif
#?if !moar
#?if jvm
try shell('uname -r', :out, :!err).out.slurp(:close).chomp;
#?endif
}

0 comments on commit 0ecd037

Please sign in to comment.
You can’t perform that action at this time.