Merge pull request #137712 from hrhino/fix/dust

dust: fix
This commit is contained in:
Sandro 2021-09-14 14:05:55 +02:00 committed by GitHub
commit b6a1ab75d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View file

@ -1,4 +1,6 @@
{ lib, stdenv, pixie, fetchFromGitHub }:
{ lib, stdenv, fetchFromGitHub
, pixie, rlwrap
}:
stdenv.mkDerivation rec {
pname = "dust";
@ -16,8 +18,9 @@ stdenv.mkDerivation rec {
patches = [ ./make-paths-configurable.patch ];
configurePhase = ''
pixiePath="${pixie}/bin/pixie-vm" \
pixiePath="${pixie}/bin/pixie" \
basePath="$out/share/dust" \
rlwrapPath="${rlwrap}/bin/rlwrap" \
substituteAll dust.in dust
chmod +x dust
'';

View file

@ -73,11 +73,12 @@ new file mode 100755
index 0000000..44a7fbd
--- /dev/null
+++ b/dust.in
@@ -0,0 +1,43 @@
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+base_path=@basePath@
+pixie_path=@pixiePath@
+rlwrap_cmd=@rlwrapPath@
+
+function set_load_path() {
+ load_path=""
@ -98,11 +99,7 @@ index 0000000..44a7fbd
+
+case $1 in
+ ""|"repl")
+ rlwrap_cmd=""
+ if [ -n "`which rlwrap`" ]; then
+ rlwrap_cmd="rlwrap -aignored -n"
+ fi
+ $rlwrap_cmd $pixie_path $load_path
+ $rlwrap_cmd -aignored -n $pixie_path $load_path
+ ;;
+ "run")
+ shift