Last active
April 19, 2017 22:38
Star
You must be signed in to star a gist
Rakudo REPL OSX History File Fix
This file contains 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