Last active
April 19, 2017 22:38
-
-
Save zoffixznet/6a0d212ada41fce7aeca15fa9efcc263 to your computer and use it in GitHub Desktop.
Rakudo REPL OSX History File Fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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