Skip to content

Commit f4efa32

Browse files
committed
use printf instead of clear; use dontBuild over phases
1 parent 1bcc44c commit f4efa32

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

bashcards

+8-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@ function make_card {
7474
return 0
7575
}
7676

77+
function clearscreen {
78+
printf '\033c'
79+
return 0
80+
}
81+
82+
7783
function run_cards {
78-
clear
84+
clearscreen
7985

8086
local cards_name=$1
8187
eval "declare -A cards="${2#*=}
@@ -140,7 +146,7 @@ function select_file {
140146
opts+=("$(to_filename $file)")
141147
done
142148

143-
clear
149+
clearscreen
144150
echo "What would you like to practice?"
145151

146152
# list the files

derivation.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pkgs.stdenv.mkDerivation {
44
name = "bashcards";
55
src = ./.;
6-
phases = "unpackPhase installPhase";
6+
dontBuild = true;
77
installPhase = ''
88
mkdir -p $out/bin $out/share/man/man8
99
cp bashcards.8 $out/share/man/man8/

shell.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ bashcards = pkgs.callPackage ./derivation.nix { };
55
in
66
pkgs.mkShell {
77
buildInputs = with pkgs; [
8-
man
98
bashcards
9+
man
1010
];
1111
}

0 commit comments

Comments
 (0)