-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement fup-repl blueprint #127
- Loading branch information
1 parent
f9d088f
commit 24b3a16
Showing
3 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ writeShellScriptBin, coreutils, gnused }: | ||
let | ||
example = command: desc: ''\n\u001b[33m ${command}\u001b[0m - ${desc}''; | ||
in | ||
writeShellScriptBin "repl" '' | ||
case "$1" in | ||
"-h"|"--help"|"help") | ||
printf "%b\n\e[4mUsage\e[0m: \ | ||
${example "repl" "Loads system flake if available."} \ | ||
${example "repl /path/to/flake.nix" "Loads specified flake."}\n" | ||
;; | ||
*) | ||
if [ -z "$1" ]; then | ||
nix repl ${./repl.nix} | ||
else | ||
nix repl --arg flakePath $(${coreutils}/bin/readlink -f $1 | ${gnused}/bin/sed 's|/flake.nix||') ${./repl.nix} | ||
fi | ||
;; | ||
esac | ||
'' |
This file was deleted.
Oops, something went wrong.