Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Last active April 19, 2017 22:38
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save zoffixznet/6a0d212ada41fce7aeca15fa9efcc263 to your computer and use it in GitHub Desktop.
Rakudo REPL OSX History File Fix
alias perl6repl='perl6 -e '\''
use nqp;
sub MAIN (*%adverbs) {
REPL.^mixin(
role {
has IO::Path $!history-file;
method history-file (--> Str:D) {
return $!history-file.absolute if $!history-file.defined;
$!history-file = $*ENV<RAKUDO_HIST>
?? $*ENV<RAKUDO_HIST>.IO
!! $*HOME.add: ".perl6/rakudo-history";
note "Cannot load history: {.exception.message}"
without mkdir $!history-file.parent;
$!history-file.absolute
}
}
).new(nqp::getcomp("perl6"), %adverbs)
.repl-loop: :interactive(1), |%adverbs
}
'\'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment